From patchwork Thu Nov 19 10:50:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 7656431 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 355D89F392 for ; Thu, 19 Nov 2015 10:54:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56B2C2053E for ; Thu, 19 Nov 2015 10:54:30 +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 862F52052A for ; Thu, 19 Nov 2015 10:54:29 +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 1ZzMpU-0004fi-NW; Thu, 19 Nov 2015 10:52:40 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZzMp9-0004Lh-L5 for linux-arm-kernel@lists.infradead.org; Thu, 19 Nov 2015 10:52:20 +0000 Received: by wmec201 with SMTP id c201so19139761wme.0 for ; Thu, 19 Nov 2015 02:51:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GHaypNZxmShoPGfAAzS7DapkGfxA1V8j5X6fBAeCYxg=; b=Sysp9I7+HEoP0mYqtv8m2gVLx+dEva1y2mhBFgaEf25jR7h78TQs6iSkRgfpD/B6kq QjQ5q+vsd7D0RK8yUIOREUNGFSHmyqaukNT9orunIk3e9qE9N8mdF6DA1mY89RsaMXaO 0qHY7U3K96xQ6WFr4YmGJ9KTvjpg+61rVs3PRM59EGeXhy9gGA8GvPvRVwLoUQBQ5/n6 Ym5Q9Nvh1csSotLz4hVoSghsczva4wt2HPKCBzqA6iboZQTPOatxF7vtTvrQmOsz6Y7a fDmcIeLJqG8qAxbjyX0/KUleQnuXywWhyA2OhtA3WXJu4MiaH9lmtyFtijnzmkYlip6/ CBbA== X-Received: by 10.28.15.146 with SMTP id 140mr12499534wmp.79.1447930317958; Thu, 19 Nov 2015 02:51:57 -0800 (PST) Received: from Red.local (ANice-651-1-376-123.w86-193.abo.wanadoo.fr. [86.193.8.123]) by smtp.googlemail.com with ESMTPSA id z1sm7267760wje.35.2015.11.19.02.51.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Nov 2015 02:51:57 -0800 (PST) From: LABBE Corentin To: alexandre.belloni@free-electrons.com, a.zummo@towertech.it, linux-arm-kernel@lists.infradead.org, maxime.ripard@free-electrons.com, wens@csie.org Subject: [PATCH 3/3] rtc: sunxi: use of_device_get_match_data Date: Thu, 19 Nov 2015 11:50:10 +0100 Message-Id: <1447930210-27008-3-git-send-email-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.4.10 In-Reply-To: <1447930210-27008-1-git-send-email-clabbe.montjoie@gmail.com> References: <1447930210-27008-1-git-send-email-clabbe.montjoie@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151119_025219_978728_F76FFE2A X-CRM114-Status: GOOD ( 12.17 ) X-Spam-Score: -2.7 (--) 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: LABBE Corentin , linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com 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.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 The usage of of_device_get_match_data reduce the code size a bit. Signed-off-by: LABBE Corentin Acked-by: Chen-Yu Tsai --- drivers/rtc/rtc-sunxi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-sunxi.c b/drivers/rtc/rtc-sunxi.c index 0c08a5b..abada60 100644 --- a/drivers/rtc/rtc-sunxi.c +++ b/drivers/rtc/rtc-sunxi.c @@ -436,7 +436,6 @@ static int sunxi_rtc_probe(struct platform_device *pdev) { struct sunxi_rtc_dev *chip; struct resource *res; - const struct of_device_id *of_id; int ret; chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL); @@ -463,12 +462,11 @@ static int sunxi_rtc_probe(struct platform_device *pdev) return ret; } - of_id = of_match_device(sunxi_rtc_dt_ids, &pdev->dev); - if (!of_id) { + chip->data_year = of_device_get_match_data(&pdev->dev); + if (!chip->data_year) { dev_err(&pdev->dev, "Unable to setup RTC data\n"); return -ENODEV; } - chip->data_year = of_id->data; /* clear the alarm count value */ writel(0, chip->base + SUNXI_ALRM_DHMS);