platform: make better use of to_platform_{device,driver}() macros

This helps the code look more consistent and cleaner.

Signed-off-by: Eric Miao <[email protected]>
Cc: Kay Sievers <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Eric Miao 2009-01-31 22:47:44 +08:00 • committed by Greg Kroah-Hartman
commit 71b3e0c1ad
3 changed files with 11 additions and 16 deletions

View file

@ -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);
}