mirror of https://github.com/torvalds/linux.git
rtc: m48t86: drop needless struct m48t86_rtc_info::rtc member
The memory pointed to by the ::rtc member is managed via devres, and no code in this driver uses it past _probe(). We can drop it from the structure and just use a local temporary variable, reducing runtime memory consumption by a few bytes. Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20250304-rtc-cleanups-v2-7-d4689a71668c@linaro.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
a55d44807b
commit
013df5bdf8
|
|
@ -41,7 +41,6 @@
|
||||||
struct m48t86_rtc_info {
|
struct m48t86_rtc_info {
|
||||||
void __iomem *index_reg;
|
void __iomem *index_reg;
|
||||||
void __iomem *data_reg;
|
void __iomem *data_reg;
|
||||||
struct rtc_device *rtc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static unsigned char m48t86_readb(struct device *dev, unsigned long addr)
|
static unsigned char m48t86_readb(struct device *dev, unsigned long addr)
|
||||||
|
|
@ -219,6 +218,7 @@ static bool m48t86_verify_chip(struct platform_device *pdev)
|
||||||
static int m48t86_rtc_probe(struct platform_device *pdev)
|
static int m48t86_rtc_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct m48t86_rtc_info *info;
|
struct m48t86_rtc_info *info;
|
||||||
|
struct rtc_device *rtc;
|
||||||
unsigned char reg;
|
unsigned char reg;
|
||||||
int err;
|
int err;
|
||||||
struct nvmem_config m48t86_nvmem_cfg = {
|
struct nvmem_config m48t86_nvmem_cfg = {
|
||||||
|
|
@ -250,17 +250,17 @@ static int m48t86_rtc_probe(struct platform_device *pdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->rtc = devm_rtc_allocate_device(&pdev->dev);
|
rtc = devm_rtc_allocate_device(&pdev->dev);
|
||||||
if (IS_ERR(info->rtc))
|
if (IS_ERR(rtc))
|
||||||
return PTR_ERR(info->rtc);
|
return PTR_ERR(rtc);
|
||||||
|
|
||||||
info->rtc->ops = &m48t86_rtc_ops;
|
rtc->ops = &m48t86_rtc_ops;
|
||||||
|
|
||||||
err = devm_rtc_register_device(info->rtc);
|
err = devm_rtc_register_device(rtc);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
devm_rtc_nvmem_register(info->rtc, &m48t86_nvmem_cfg);
|
devm_rtc_nvmem_register(rtc, &m48t86_nvmem_cfg);
|
||||||
|
|
||||||
/* read battery status */
|
/* read battery status */
|
||||||
reg = m48t86_readb(&pdev->dev, M48T86_D);
|
reg = m48t86_readb(&pdev->dev, M48T86_D);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue