spi: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
7956fadd40
commit
e1f16b0493
|
@ -686,8 +686,7 @@ static int cdns_spi_remove(struct platform_device *pdev)
|
|||
*/
|
||||
static int __maybe_unused cdns_spi_suspend(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct spi_master *master = platform_get_drvdata(pdev);
|
||||
struct spi_master *master = dev_get_drvdata(dev);
|
||||
|
||||
return spi_master_suspend(master);
|
||||
}
|
||||
|
@ -702,8 +701,7 @@ static int __maybe_unused cdns_spi_suspend(struct device *dev)
|
|||
*/
|
||||
static int __maybe_unused cdns_spi_resume(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct spi_master *master = platform_get_drvdata(pdev);
|
||||
struct spi_master *master = dev_get_drvdata(dev);
|
||||
struct cdns_spi *xspi = spi_master_get_devdata(master);
|
||||
|
||||
cdns_spi_init_hw(xspi);
|
||||
|
|
|
@ -906,8 +906,7 @@ static int zynqmp_qspi_start_transfer(struct spi_master *master,
|
|||
*/
|
||||
static int __maybe_unused zynqmp_qspi_suspend(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct spi_master *master = platform_get_drvdata(pdev);
|
||||
struct spi_master *master = dev_get_drvdata(dev);
|
||||
|
||||
spi_master_suspend(master);
|
||||
|
||||
|
@ -927,8 +926,7 @@ static int __maybe_unused zynqmp_qspi_suspend(struct device *dev)
|
|||
*/
|
||||
static int __maybe_unused zynqmp_qspi_resume(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct spi_master *master = platform_get_drvdata(pdev);
|
||||
struct spi_master *master = dev_get_drvdata(dev);
|
||||
struct zynqmp_qspi *xqspi = spi_master_get_devdata(master);
|
||||
int ret = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue