Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133441
b: refs/heads/master
c: 71b3e0c
h: refs/heads/master
i:
  133439: d317c0d
v: v3
  • Loading branch information
Eric Miao authored and Greg Kroah-Hartman committed Mar 24, 2009
1 parent 2a3ef3e commit daec078
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 49b420a13ff95b449947181190b08367348e3e1b
refs/heads/master: 71b3e0c1ad90f28e34c105069175cbd4edb43dfa
21 changes: 9 additions & 12 deletions trunk/drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,8 @@ static int platform_uevent(struct device *dev, struct kobj_uevent_env *env)
*/
static int platform_match(struct device *dev, struct device_driver *drv)
{
struct platform_device *pdev;
struct platform_device *pdev = to_platform_device(dev);

pdev = container_of(dev, struct platform_device, dev);
return (strcmp(pdev->name, drv->name) == 0);
}

Expand All @@ -623,26 +622,24 @@ static int platform_legacy_suspend(struct device *dev, pm_message_t mesg)

static int platform_legacy_suspend_late(struct device *dev, pm_message_t mesg)
{
struct platform_driver *drv = to_platform_driver(dev->driver);
struct platform_device *pdev;
struct platform_driver *pdrv = to_platform_driver(dev->driver);
struct platform_device *pdev = to_platform_device(dev);
int ret = 0;

pdev = container_of(dev, struct platform_device, dev);
if (dev->driver && drv->suspend_late)
ret = drv->suspend_late(pdev, mesg);
if (dev->driver && pdrv->suspend_late)
ret = pdrv->suspend_late(pdev, mesg);

return ret;
}

static int platform_legacy_resume_early(struct device *dev)
{
struct platform_driver *drv = to_platform_driver(dev->driver);
struct platform_device *pdev;
struct platform_driver *pdrv = to_platform_driver(dev->driver);
struct platform_device *pdev = to_platform_device(dev);
int ret = 0;

pdev = container_of(dev, struct platform_device, dev);
if (dev->driver && drv->resume_early)
ret = drv->resume_early(pdev);
if (dev->driver && pdrv->resume_early)
ret = pdrv->resume_early(pdev);

return ret;
}
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/isdn/gigaset/ser-gigaset.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,7 @@ static void gigaset_freecshw(struct cardstate *cs)

static void gigaset_device_release(struct device *dev)
{
struct platform_device *pdev =
container_of(dev, struct platform_device, dev);
struct platform_device *pdev = to_platform_device(dev);

/* adapted from platform_device_release() in drivers/base/platform.c */
//FIXME is this actually necessary?
Expand Down

0 comments on commit daec078

Please sign in to comment.