Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934000AbbKSKwB (ORCPT ); Thu, 19 Nov 2015 05:52:01 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:38589 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758363AbbKSKv7 (ORCPT ); Thu, 19 Nov 2015 05:51:59 -0500 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 Cc: LABBE Corentin , linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com 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> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1318 Lines: 42 The usage of of_device_get_match_data reduce the code size a bit. Signed-off-by: LABBE Corentin --- 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); -- 2.4.10 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/