From patchwork Fri Nov 27 06:43:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 7711071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3F9769F750 for ; Fri, 27 Nov 2015 06:45:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A616205F3 for ; Fri, 27 Nov 2015 06:45:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A89F220584 for ; Fri, 27 Nov 2015 06:45:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a2ClK-0007mx-8B; Fri, 27 Nov 2015 06:44:06 +0000 Received: from smtp.csie.ntu.edu.tw ([140.112.30.61]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a2ClF-0007fx-QY for linux-arm-kernel@lists.infradead.org; Fri, 27 Nov 2015 06:44:03 +0000 Received: from mirror2.csie.ntu.edu.tw (mirror2.csie.ntu.edu.tw [140.112.30.76]) (Authenticated sender: b93043) by smtp.csie.ntu.edu.tw (Postfix) with ESMTPSA id DFFD220E0A; Fri, 27 Nov 2015 14:43:37 +0800 (CST) Received: by mirror2.csie.ntu.edu.tw (Postfix, from userid 1000) id 9ECA15FA0E; Fri, 27 Nov 2015 14:43:37 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , Lee Jones , Samuel Ortiz Subject: [PATCH v5 3/9] mfd: axp20x: use dev->driver->of_match_table in axp20x_match_device() Date: Fri, 27 Nov 2015 14:43:24 +0800 Message-Id: <1448606610-32647-4-git-send-email-wens@csie.org> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1448606610-32647-1-git-send-email-wens@csie.org> References: <1448606610-32647-1-git-send-email-wens@csie.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151126_224402_066089_F9BF7A29 X-CRM114-Status: GOOD ( 10.91 ) X-Spam-Score: -5.2 (-----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Pawel Moll , Ian Campbell , linux-sunxi@googlegroups.com, Andy Shevchenko , linux-kernel@vger.kernel.org, Hans de Goede , Chen-Yu Tsai , Rob Herring , Mark Brown , Kumar Gala , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In axp20x_match_device(), match the of_device_id table bound to the device driver instead of pointing to axp20x_of_match directly. This will allow us to keep axp20x_match_device() unmodified when we expand the axp20x driver into multiple ones covering different interface types. of_device_get_match_data() cannot be used here as we need to know if it failed to get a match, or if the match data value just happened to be 0, as it is for the AXP152. Signed-off-by: Chen-Yu Tsai --- drivers/mfd/axp20x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index 685a78614f83..3e186f2dcac3 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -613,7 +613,7 @@ static int axp20x_match_device(struct axp20x_dev *axp20x) const struct of_device_id *of_id; if (dev->of_node) { - of_id = of_match_device(axp20x_of_match, dev); + of_id = of_match_device(dev->driver->of_match_table, dev); if (!of_id) { dev_err(dev, "Unable to match OF ID\n"); return -ENODEV;