Commit 909b3456 authored by Ryder Lee's avatar Ryder Lee Committed by Ulf Hansson

mmc: mediatek: use of_device_get_match_data()

The usage of of_device_get_match_data() reduce the code size a bit.

Also, the only way to call msdc_drv_probe() is to match an entry in
msdc_of_ids[], so of_id cannot be NULL.
Signed-off-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent be17355a
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/pinctrl/consumer.h> #include <linux/pinctrl/consumer.h>
...@@ -1820,7 +1821,6 @@ static int msdc_drv_probe(struct platform_device *pdev) ...@@ -1820,7 +1821,6 @@ static int msdc_drv_probe(struct platform_device *pdev)
struct mmc_host *mmc; struct mmc_host *mmc;
struct msdc_host *host; struct msdc_host *host;
struct resource *res; struct resource *res;
const struct of_device_id *of_id;
int ret; int ret;
if (!pdev->dev.of_node) { if (!pdev->dev.of_node) {
...@@ -1828,9 +1828,6 @@ static int msdc_drv_probe(struct platform_device *pdev) ...@@ -1828,9 +1828,6 @@ static int msdc_drv_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
of_id = of_match_node(msdc_of_ids, pdev->dev.of_node);
if (!of_id)
return -EINVAL;
/* Allocate MMC host for this device */ /* Allocate MMC host for this device */
mmc = mmc_alloc_host(sizeof(struct msdc_host), &pdev->dev); mmc = mmc_alloc_host(sizeof(struct msdc_host), &pdev->dev);
if (!mmc) if (!mmc)
...@@ -1899,7 +1896,7 @@ static int msdc_drv_probe(struct platform_device *pdev) ...@@ -1899,7 +1896,7 @@ static int msdc_drv_probe(struct platform_device *pdev)
msdc_of_property_parse(pdev, host); msdc_of_property_parse(pdev, host);
host->dev = &pdev->dev; host->dev = &pdev->dev;
host->dev_comp = of_id->data; host->dev_comp = of_device_get_match_data(&pdev->dev);
host->mmc = mmc; host->mmc = mmc;
host->src_clk_freq = clk_get_rate(host->src_clk); host->src_clk_freq = clk_get_rate(host->src_clk);
/* Set host parameters to mmc */ /* Set host parameters to mmc */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment