spi: Use dev_get_drvdata at appropriate places
Use dev_get_drvdata() instead of platform_get_drvdata(to_platform_device(dev)). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
@@ -480,8 +480,7 @@ static int bcm63xx_spi_remove(struct platform_device *pdev)
|
|||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
static int bcm63xx_spi_suspend(struct device *dev)
|
static int bcm63xx_spi_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct spi_master *master =
|
struct spi_master *master = dev_get_drvdata(dev);
|
||||||
platform_get_drvdata(to_platform_device(dev));
|
|
||||||
struct bcm63xx_spi *bs = spi_master_get_devdata(master);
|
struct bcm63xx_spi *bs = spi_master_get_devdata(master);
|
||||||
|
|
||||||
spi_master_suspend(master);
|
spi_master_suspend(master);
|
||||||
@@ -493,8 +492,7 @@ static int bcm63xx_spi_suspend(struct device *dev)
|
|||||||
|
|
||||||
static int bcm63xx_spi_resume(struct device *dev)
|
static int bcm63xx_spi_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct spi_master *master =
|
struct spi_master *master = dev_get_drvdata(dev);
|
||||||
platform_get_drvdata(to_platform_device(dev));
|
|
||||||
struct bcm63xx_spi *bs = spi_master_get_devdata(master);
|
struct bcm63xx_spi *bs = spi_master_get_devdata(master);
|
||||||
|
|
||||||
clk_prepare_enable(bs->clk);
|
clk_prepare_enable(bs->clk);
|
||||||
|
|||||||
@@ -558,7 +558,7 @@ static int mcfqspi_resume(struct device *dev)
|
|||||||
#ifdef CONFIG_PM_RUNTIME
|
#ifdef CONFIG_PM_RUNTIME
|
||||||
static int mcfqspi_runtime_suspend(struct device *dev)
|
static int mcfqspi_runtime_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct mcfqspi *mcfqspi = platform_get_drvdata(to_platform_device(dev));
|
struct mcfqspi *mcfqspi = dev_get_drvdata(dev);
|
||||||
|
|
||||||
clk_disable(mcfqspi->clk);
|
clk_disable(mcfqspi->clk);
|
||||||
|
|
||||||
@@ -567,7 +567,7 @@ static int mcfqspi_runtime_suspend(struct device *dev)
|
|||||||
|
|
||||||
static int mcfqspi_runtime_resume(struct device *dev)
|
static int mcfqspi_runtime_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct mcfqspi *mcfqspi = platform_get_drvdata(to_platform_device(dev));
|
struct mcfqspi *mcfqspi = dev_get_drvdata(dev);
|
||||||
|
|
||||||
clk_enable(mcfqspi->clk);
|
clk_enable(mcfqspi->clk);
|
||||||
|
|
||||||
|
|||||||
@@ -690,7 +690,7 @@ static int s3c24xx_spi_remove(struct platform_device *dev)
|
|||||||
|
|
||||||
static int s3c24xx_spi_suspend(struct device *dev)
|
static int s3c24xx_spi_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct s3c24xx_spi *hw = platform_get_drvdata(to_platform_device(dev));
|
struct s3c24xx_spi *hw = dev_get_drvdata(dev);
|
||||||
|
|
||||||
if (hw->pdata && hw->pdata->gpio_setup)
|
if (hw->pdata && hw->pdata->gpio_setup)
|
||||||
hw->pdata->gpio_setup(hw->pdata, 0);
|
hw->pdata->gpio_setup(hw->pdata, 0);
|
||||||
@@ -701,7 +701,7 @@ static int s3c24xx_spi_suspend(struct device *dev)
|
|||||||
|
|
||||||
static int s3c24xx_spi_resume(struct device *dev)
|
static int s3c24xx_spi_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct s3c24xx_spi *hw = platform_get_drvdata(to_platform_device(dev));
|
struct s3c24xx_spi *hw = dev_get_drvdata(dev);
|
||||||
|
|
||||||
s3c24xx_spi_initialsetup(hw);
|
s3c24xx_spi_initialsetup(hw);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -599,8 +599,7 @@ static int spi_sirfsoc_remove(struct platform_device *pdev)
|
|||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
static int spi_sirfsoc_suspend(struct device *dev)
|
static int spi_sirfsoc_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct spi_master *master = dev_get_drvdata(dev);
|
||||||
struct spi_master *master = platform_get_drvdata(pdev);
|
|
||||||
struct sirfsoc_spi *sspi = spi_master_get_devdata(master);
|
struct sirfsoc_spi *sspi = spi_master_get_devdata(master);
|
||||||
|
|
||||||
clk_disable(sspi->clk);
|
clk_disable(sspi->clk);
|
||||||
@@ -609,8 +608,7 @@ static int spi_sirfsoc_suspend(struct device *dev)
|
|||||||
|
|
||||||
static int spi_sirfsoc_resume(struct device *dev)
|
static int spi_sirfsoc_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct spi_master *master = dev_get_drvdata(dev);
|
||||||
struct spi_master *master = platform_get_drvdata(pdev);
|
|
||||||
struct sirfsoc_spi *sspi = spi_master_get_devdata(master);
|
struct sirfsoc_spi *sspi = spi_master_get_devdata(master);
|
||||||
|
|
||||||
clk_enable(sspi->clk);
|
clk_enable(sspi->clk);
|
||||||
|
|||||||
Reference in New Issue
Block a user