From patchwork Wed Oct 4 12:13:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 821285 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3y6ZYL4nSgz9t16 for ; Wed, 4 Oct 2017 23:13:10 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751922AbdJDMNK (ORCPT ); Wed, 4 Oct 2017 08:13:10 -0400 Received: from albert.telenet-ops.be ([195.130.137.90]:56100 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751699AbdJDMNJ (ORCPT ); Wed, 4 Oct 2017 08:13:09 -0400 Received: from ayla.of.borg ([84.195.106.246]) by albert.telenet-ops.be with bizsmtp id HQD81w00W5JzmfG06QD8vh; Wed, 04 Oct 2017 14:13:08 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1dziY0-0000hb-BO; Wed, 04 Oct 2017 14:13:08 +0200 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1dziY0-0003D3-AC; Wed, 04 Oct 2017 14:13:08 +0200 From: Geert Uytterhoeven To: Tejun Heo Cc: linux-ide@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] ata: sata_rcar: Use of_device_get_match_data() helper Date: Wed, 4 Oct 2017 14:13:07 +0200 Message-Id: <1507119187-12297-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 2.7.4 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org 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 Acked-by: Sergei Shtylyov Reviewed-by: Simon Horman --- 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");