summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorEric Miao <eric.miao@marvell.com>2009-01-31 15:47:44 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-25 00:38:24 +0100
commit71b3e0c1ad90f28e34c105069175cbd4edb43dfa (patch)
treeaf7f1dd890d10acc33e36a923d2604ff26dfb071 /drivers/block
parentdriver core: check bus->match without holding device lock (diff)
downloadlinux-71b3e0c1ad90f28e34c105069175cbd4edb43dfa.tar.xz
linux-71b3e0c1ad90f28e34c105069175cbd4edb43dfa.zip
platform: make better use of to_platform_{device,driver}() macros
This helps the code look more consistent and cleaner. Signed-off-by: Eric Miao <eric.miao@marvell.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/floppy.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 83d8ed39433d..c2c95e614506 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4135,10 +4135,9 @@ static int have_no_fdc = -ENODEV;
static ssize_t floppy_cmos_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct platform_device *p;
+ struct platform_device *p = to_platform_device(dev);
int drive;
- p = container_of(dev, struct platform_device,dev);
drive = p->id;
return sprintf(buf, "%X\n", UDP->cmos);
}