spi doesn't need class_device
Make the SPI framework and drivers stop using class_device. Update docs accordingly ... highlighting just which sysfs paths should be "safe"/stable. Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
cd58310d77
commit
49dce689ad
@ -195,7 +195,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
|
||||
|
||||
/**
|
||||
* struct spi_master - interface to SPI master controller
|
||||
* @cdev: class interface to this driver
|
||||
* @dev: device interface to this driver
|
||||
* @bus_num: board-specific (and often SOC-specific) identifier for a
|
||||
* given SPI controller.
|
||||
* @num_chipselect: chipselects are used to distinguish individual
|
||||
@ -222,7 +222,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
|
||||
* message's completion function when the transaction completes.
|
||||
*/
|
||||
struct spi_master {
|
||||
struct class_device cdev;
|
||||
struct device dev;
|
||||
|
||||
/* other than negative (== assign one dynamically), bus_num is fully
|
||||
* board-specific. usually that simplifies to being SOC-specific.
|
||||
@ -268,17 +268,17 @@ struct spi_master {
|
||||
|
||||
static inline void *spi_master_get_devdata(struct spi_master *master)
|
||||
{
|
||||
return class_get_devdata(&master->cdev);
|
||||
return dev_get_drvdata(&master->dev);
|
||||
}
|
||||
|
||||
static inline void spi_master_set_devdata(struct spi_master *master, void *data)
|
||||
{
|
||||
class_set_devdata(&master->cdev, data);
|
||||
dev_set_drvdata(&master->dev, data);
|
||||
}
|
||||
|
||||
static inline struct spi_master *spi_master_get(struct spi_master *master)
|
||||
{
|
||||
if (!master || !class_device_get(&master->cdev))
|
||||
if (!master || !get_device(&master->dev))
|
||||
return NULL;
|
||||
return master;
|
||||
}
|
||||
@ -286,7 +286,7 @@ static inline struct spi_master *spi_master_get(struct spi_master *master)
|
||||
static inline void spi_master_put(struct spi_master *master)
|
||||
{
|
||||
if (master)
|
||||
class_device_put(&master->cdev);
|
||||
put_device(&master->dev);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user