Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e2c0f3f authored by Jingoo Han's avatar Jingoo Han Committed by Chris Ball
Browse files

mmc: host: use platform_{get,set}_drvdata()



Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Acked-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 7913ae7d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -703,7 +703,7 @@ static int cb710_mmc_init(struct platform_device *pdev)
	if (!mmc)
	if (!mmc)
		return -ENOMEM;
		return -ENOMEM;


	dev_set_drvdata(&pdev->dev, mmc);
	platform_set_drvdata(pdev, mmc);


	/* harmless (maybe) magic */
	/* harmless (maybe) magic */
	pci_read_config_dword(chip->pdev, 0x48, &val);
	pci_read_config_dword(chip->pdev, 0x48, &val);
+1 −1
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@ struct cb710_mmc_reader {


static inline struct mmc_host *cb710_slot_to_mmc(struct cb710_slot *slot)
static inline struct mmc_host *cb710_slot_to_mmc(struct cb710_slot *slot)
{
{
	return dev_get_drvdata(&slot->pdev.dev);
	return platform_get_drvdata(&slot->pdev);
}
}


static inline struct cb710_slot *cb710_mmc_to_slot(struct mmc_host *mmc)
static inline struct cb710_slot *cb710_mmc_to_slot(struct mmc_host *mmc)
+3 −3
Original line number Original line Diff line number Diff line
@@ -51,7 +51,7 @@ struct sh_mobile_sdhi {


static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int *f)
static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int *f)
{
{
	struct mmc_host *mmc = dev_get_drvdata(&pdev->dev);
	struct mmc_host *mmc = platform_get_drvdata(pdev);
	struct tmio_mmc_host *host = mmc_priv(mmc);
	struct tmio_mmc_host *host = mmc_priv(mmc);
	struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data);
	struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data);
	int ret = clk_enable(priv->clk);
	int ret = clk_enable(priv->clk);
@@ -64,7 +64,7 @@ static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int


static void sh_mobile_sdhi_clk_disable(struct platform_device *pdev)
static void sh_mobile_sdhi_clk_disable(struct platform_device *pdev)
{
{
	struct mmc_host *mmc = dev_get_drvdata(&pdev->dev);
	struct mmc_host *mmc = platform_get_drvdata(pdev);
	struct tmio_mmc_host *host = mmc_priv(mmc);
	struct tmio_mmc_host *host = mmc_priv(mmc);
	struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data);
	struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data);
	clk_disable(priv->clk);
	clk_disable(priv->clk);
@@ -119,7 +119,7 @@ static int sh_mobile_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)


static void sh_mobile_sdhi_cd_wakeup(const struct platform_device *pdev)
static void sh_mobile_sdhi_cd_wakeup(const struct platform_device *pdev)
{
{
	mmc_detect_change(dev_get_drvdata(&pdev->dev), msecs_to_jiffies(100));
	mmc_detect_change(platform_get_drvdata(pdev), msecs_to_jiffies(100));
}
}


static const struct sh_mobile_sdhi_ops sdhi_ops = {
static const struct sh_mobile_sdhi_ops sdhi_ops = {