Re: [PATCH] power: Add legacy pm ops usage warning

From: Shuah Khan
Date: Tue Nov 05 2013 - 13:41:22 EST


On 11/01/2013 05:04 PM, Rafael J. Wysocki wrote:
On Friday, November 01, 2013 09:07:04 AM Shuah Khan wrote:
Add legacy pm_ops usage checks to device_pm_add() when a device gets added
to PM core's list of active devices. If legacy pm_ops usage is found at its
class, bus, driver level, print warning message to indicate the driver code
needs updating to use dev pm ops interfaces. This will help serve as a way
to track drivers that still use legacy pm ops and fix them.

I think it would be much better to do these checks during bus type, class or
driver registration, because if you register a bus type with legacy PM, for
example, the check in device_pm_add() will trigger for all devices with that
bus type.

Thanks!

Rafael,

Correct. device_pm_add() triggers for all devices that use the driver. On the other hand, the check is done only when the device gets added to the pm core. I do like that part.

I am testing with adding checks driver_register() to look for suspend at bus level. I am not seeing the same set of drivers I saw with the check in device_pm_add(), which is puzzling. I am working on testing still. Keep you posted.

-- Shuah

--
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
shuah.kh@xxxxxxxxxxx | (970) 672-0658
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/