[PATCH] Software Suspend 2 for ppc64 (2/2 - virtual drivers)

Santiago Leon santil at us.ibm.com
Thu Jul 21 05:06:36 EST 2005


>>+	if (drv && drv->suspend)
>>+		return drv->suspend(vio_dev, state);
>>+	else
> 
>         ^^^^
> else not needed.

ok, will remove it...

>>+	if (drv && drv->resume)
>>+		drv->resume(vio_dev);
> 
>                 ^
> Shouldn't this have "return" here?

yes it should...

>>+	.suspend     = ibmveth_suspend,
>>+	.resume      = ibmveth_resume
> 
> You might as well terminate this witha a comma ...

yep...

>> static inline struct vio_driver *to_vio_driver(struct device_driver *drv)
>> {
>>-	return container_of(drv, struct vio_driver, driver);
>>+	return drv ? container_of(drv, struct vio_driver, driver) : NULL;
> 
> 
> So who is passing a NULL to to_vio_driver?

vio_device_suspend() calls to_vio_driver() for every device in /vdevice 
and in there there's devices IBM,sp at 4000, nvram at 4002, and rtc at 4001 that 
don't have a vio_driver...

Thanks for the comments...
-- 
Santiago A. Leon
Power Linux Development
IBM Linux Technology Center




More information about the Linuxppc64-dev mailing list