Commit 50e49bee authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Linus Torvalds

rtc: do not use container_of macro as an argument for to_platform_device

The to_platform_device macro itself uses container_of macro.  Nested use
of container_of macro causes following sparse warnings:

rtc-ds1553.c:259:3: warning: symbol '__mptr' shadows an earlier one
rtc-ds1553.c:259:3: originally declared here
Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Cc: Andrew Sharp <andy.sharp@lsi.com>
Cc: Thomas Hommel <thomas.hommel@gefanuc.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3151520d
...@@ -255,8 +255,8 @@ static ssize_t ds1553_nvram_read(struct kobject *kobj, ...@@ -255,8 +255,8 @@ static ssize_t ds1553_nvram_read(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t pos, size_t size) char *buf, loff_t pos, size_t size)
{ {
struct platform_device *pdev = struct device *dev = container_of(kobj, struct device, kobj);
to_platform_device(container_of(kobj, struct device, kobj)); struct platform_device *pdev = to_platform_device(dev);
struct rtc_plat_data *pdata = platform_get_drvdata(pdev); struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr; void __iomem *ioaddr = pdata->ioaddr;
ssize_t count; ssize_t count;
...@@ -270,8 +270,8 @@ static ssize_t ds1553_nvram_write(struct kobject *kobj, ...@@ -270,8 +270,8 @@ static ssize_t ds1553_nvram_write(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t pos, size_t size) char *buf, loff_t pos, size_t size)
{ {
struct platform_device *pdev = struct device *dev = container_of(kobj, struct device, kobj);
to_platform_device(container_of(kobj, struct device, kobj)); struct platform_device *pdev = to_platform_device(dev);
struct rtc_plat_data *pdata = platform_get_drvdata(pdev); struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr; void __iomem *ioaddr = pdata->ioaddr;
ssize_t count; ssize_t count;
......
...@@ -131,8 +131,8 @@ static ssize_t ds1742_nvram_read(struct kobject *kobj, ...@@ -131,8 +131,8 @@ static ssize_t ds1742_nvram_read(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t pos, size_t size) char *buf, loff_t pos, size_t size)
{ {
struct platform_device *pdev = struct device *dev = container_of(kobj, struct device, kobj);
to_platform_device(container_of(kobj, struct device, kobj)); struct platform_device *pdev = to_platform_device(dev);
struct rtc_plat_data *pdata = platform_get_drvdata(pdev); struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr_nvram; void __iomem *ioaddr = pdata->ioaddr_nvram;
ssize_t count; ssize_t count;
...@@ -146,8 +146,8 @@ static ssize_t ds1742_nvram_write(struct kobject *kobj, ...@@ -146,8 +146,8 @@ static ssize_t ds1742_nvram_write(struct kobject *kobj,
struct bin_attribute *bin_attr, struct bin_attribute *bin_attr,
char *buf, loff_t pos, size_t size) char *buf, loff_t pos, size_t size)
{ {
struct platform_device *pdev = struct device *dev = container_of(kobj, struct device, kobj);
to_platform_device(container_of(kobj, struct device, kobj)); struct platform_device *pdev = to_platform_device(dev);
struct rtc_plat_data *pdata = platform_get_drvdata(pdev); struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr_nvram; void __iomem *ioaddr = pdata->ioaddr_nvram;
ssize_t count; ssize_t count;
......
...@@ -247,8 +247,8 @@ static ssize_t stk17ta8_nvram_read(struct kobject *kobj, ...@@ -247,8 +247,8 @@ static ssize_t stk17ta8_nvram_read(struct kobject *kobj,
struct bin_attribute *attr, char *buf, struct bin_attribute *attr, char *buf,
loff_t pos, size_t size) loff_t pos, size_t size)
{ {
struct platform_device *pdev = struct device *dev = container_of(kobj, struct device, kobj);
to_platform_device(container_of(kobj, struct device, kobj)); struct platform_device *pdev = to_platform_device(dev);
struct rtc_plat_data *pdata = platform_get_drvdata(pdev); struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr; void __iomem *ioaddr = pdata->ioaddr;
ssize_t count; ssize_t count;
...@@ -262,8 +262,8 @@ static ssize_t stk17ta8_nvram_write(struct kobject *kobj, ...@@ -262,8 +262,8 @@ static ssize_t stk17ta8_nvram_write(struct kobject *kobj,
struct bin_attribute *attr, char *buf, struct bin_attribute *attr, char *buf,
loff_t pos, size_t size) loff_t pos, size_t size)
{ {
struct platform_device *pdev = struct device *dev = container_of(kobj, struct device, kobj);
to_platform_device(container_of(kobj, struct device, kobj)); struct platform_device *pdev = to_platform_device(dev);
struct rtc_plat_data *pdata = platform_get_drvdata(pdev); struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr; void __iomem *ioaddr = pdata->ioaddr;
ssize_t count; ssize_t count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment