* [PATCH] ata: sata_rcar: Use of_device_get_match_data() helper
@ 2017-10-04 12:13 Geert Uytterhoeven
2017-10-04 12:51 ` Sergei Shtylyov
2017-10-05 9:13 ` Simon Horman
0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2017-10-04 12:13 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, linux-renesas-soc, Geert Uytterhoeven
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>
---
drivers/ata/sata_rcar.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 537d11869069aae7..80ee2f2a50d02872 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");
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] ata: sata_rcar: Use of_device_get_match_data() helper
2017-10-04 12:13 [PATCH] ata: sata_rcar: Use of_device_get_match_data() helper Geert Uytterhoeven
@ 2017-10-04 12:51 ` Sergei Shtylyov
2017-10-05 9:13 ` Simon Horman
1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2017-10-04 12:51 UTC (permalink / raw)
To: Geert Uytterhoeven, Tejun Heo; +Cc: linux-ide, linux-renesas-soc
On 10/04/2017 03:13 PM, Geert Uytterhoeven wrote:
> 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>
MBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ata: sata_rcar: Use of_device_get_match_data() helper
2017-10-04 12:13 [PATCH] ata: sata_rcar: Use of_device_get_match_data() helper Geert Uytterhoeven
2017-10-04 12:51 ` Sergei Shtylyov
@ 2017-10-05 9:13 ` Simon Horman
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2017-10-05 9:13 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Tejun Heo, linux-ide, linux-renesas-soc
On Wed, Oct 04, 2017 at 02:13:07PM +0200, Geert Uytterhoeven wrote:
> 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>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-05 9:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-04 12:13 [PATCH] ata: sata_rcar: Use of_device_get_match_data() helper Geert Uytterhoeven
2017-10-04 12:51 ` Sergei Shtylyov
2017-10-05 9:13 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox