summaryrefslogtreecommitdiff
path: root/drivers/ata/sata_rcar.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2017-10-04 14:13:07 +0200
committerTejun Heo <tj@kernel.org>2017-10-04 07:18:29 -0700
commit03b623fbc5d8d24d45d4e8cd4ba245b0170891f3 (patch)
treeeac47c30472e46d47b631e0cbfbdaa825399f120 /drivers/ata/sata_rcar.c
parent8df82c13a3756f831b0d748226ce932515728e04 (diff)
ata: sata_rcar: Use of_device_get_match_data() helper
Use the of_device_get_match_data() helper instead of open coding. Note that the sata_rcar driver is used with DT only, so there's always a valid match. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/sata_rcar.c')
-rw-r--r--drivers/ata/sata_rcar.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 537d11869069..80ee2f2a50d0 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -872,7 +872,6 @@ MODULE_DEVICE_TABLE(of, sata_rcar_match);
static int sata_rcar_probe(struct platform_device *pdev)
{
- const struct of_device_id *of_id;
struct ata_host *host;
struct sata_rcar_priv *priv;
struct resource *mem;
@@ -888,11 +887,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
- of_id = of_match_device(sata_rcar_match, &pdev->dev);
- if (!of_id)
- return -ENODEV;
-
- priv->type = (enum sata_rcar_type)of_id->data;
+ priv->type = (enum sata_rcar_type)of_device_get_match_data(&pdev->dev);
priv->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(priv->clk)) {
dev_err(&pdev->dev, "failed to get access to sata clock\n");