]> Git Repo - linux.git/commit
counter: Use container_of instead of drvdata to track counter_device
authorUwe Kleine-König <[email protected]>
Thu, 30 Dec 2021 15:02:38 +0000 (16:02 +0100)
committerGreg Kroah-Hartman <[email protected]>
Thu, 30 Dec 2021 16:44:05 +0000 (17:44 +0100)
commitb56346ddbd82f674db02453ecce60dd91f97b78c
tree6f7af09aad8eeba4879e89c448992c4ca49a68db
parent6b0b80ac103b2a40c72a47c301745fd1f4ef4697
counter: Use container_of instead of drvdata to track counter_device

The counter core uses drvdata to find a struct counter_device from a
struct device. However as the device is a member of struct counter_device,
the lookup can be done faster (and a bit type safe) using container_of.

There are no other users of drvdata, so the call to dev_set_drvdata can
go away, too.

Reviewed-by: Jonathan Cameron <[email protected]>
Acked-by: William Breathitt Gray <[email protected]>
Signed-off-by: Uwe Kleine-König <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/counter/counter-core.c
This page took 0.051452 seconds and 4 git commands to generate.