From patchwork Fri Jan 18 13:28:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 155928 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3257170jaa; Fri, 18 Jan 2019 05:28:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4/Widk4RXWkXKzn3K0OTseJxt1g2+d24ZNDuRb8CmG+LXEC3zTvA0FbflIW0n3r/YyKz8o X-Received: by 2002:a63:d301:: with SMTP id b1mr17718086pgg.61.1547818129277; Fri, 18 Jan 2019 05:28:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547818129; cv=none; d=google.com; s=arc-20160816; b=txN50vb6z43/FXKUmikb5b7gShWAZBOcX4RfF818gyiHeeZL/JAovSXCPByp/nYx+a /XRgqAvK9GizrljP6lQTxgsa8x8Yz6d0nrIYHz8Y3ZCDZti+rB8JRB6K5r+M7Xs78m2Z TaQJA0GiaPqpq1GIDqWzesL/9NKOC5dgDetc9FXRzJa5WY4WOvaHqWdB6QbnCUVIr4JY CpNHaFyHTBifyIUNZfjJ1FBGPXXpraL4VlYWpFTJMFmNJBrIoBVeRqctRVPHe/qU6h6x BuHalAXa1b9VRksARiXKsqWmlw4AIW0dROu9rpZgEbFRywPXKO7i2IW4V9DoVMQJ8rvb 3dwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=L6FPGWfIKhhmcvf+DKkC4G1EAjrk+deIgEZEBlDM8C0=; b=unIO9t1VfncA1Dcyxx3Lij5sIKAGW+SWFuJVjqoV/0uCkSqitWaAd/Ih3s4TAVboME qZsE5goKFs/62Pr64q3muIkNRVoYM9s1IDc3KBLjJCM2DZ5ZygZnSoDmzcI87DLx9Xpg 83MlYKtEH0etWox3fcUnIToCxPCgPasJjfDIkeRlJnrbM0y7mqZxCuntW4qiAEQ9Ojei nYYldPUtsHx9OFAj9ccGCjeqQox3m4ma+fXMhh4c3sQlE7UAWV+R+9nFuZ1I1lo3VycT 43H4Ai6Aja3ZWcoWQQvWpTNyc4fLRoelsKhE7nMNeJdq/bstjp97eLHrAd76KVYlSvpI 8Y6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="Kko2/4n9"; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17si4875826pga.566.2019.01.18.05.28.49; Fri, 18 Jan 2019 05:28:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="Kko2/4n9"; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727017AbfARN2s (ORCPT + 3 others); Fri, 18 Jan 2019 08:28:48 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:39753 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbfARN2s (ORCPT ); Fri, 18 Jan 2019 08:28:48 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190118132847euoutp0289d6cf30ed8a24ba8e4c1d55ad357c18~69GLI4sLv1541315413euoutp02f; Fri, 18 Jan 2019 13:28:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190118132847euoutp0289d6cf30ed8a24ba8e4c1d55ad357c18~69GLI4sLv1541315413euoutp02f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1547818127; bh=L6FPGWfIKhhmcvf+DKkC4G1EAjrk+deIgEZEBlDM8C0=; h=From:To:Cc:Subject:Date:References:From; b=Kko2/4n9s5gPCBUNY5M1A3DGQAfPSJwE51UiAXzerKe96jnnTiUSyVrgtZ/3gDE3b xNhNRuMYAZsVn0YjB2AIGLYd9LPDoJUbsznsfTRFiKHcuzJMOqbk/BrhUrJ/boOZe+ ol1OWq+64Y3UyAFrnjk/S3G/z2K1EgubwDrV5qO8= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190118132846eucas1p2fe6f95e420886392b186e7f76c51607c~69GKdf16q0282402824eucas1p2E; Fri, 18 Jan 2019 13:28:46 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 0A.26.04294.D84D14C5; Fri, 18 Jan 2019 13:28:46 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190118132845eucas1p2c3e5f6dadb6af90a3701fca03599e094~69GJxQnmA0861308613eucas1p2i; Fri, 18 Jan 2019 13:28:45 +0000 (GMT) X-AuditID: cbfec7f4-835ff700000010c6-9a-5c41d48df859 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id FD.60.04284.D84D14C5; Fri, 18 Jan 2019 13:28:45 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PLJ0099K43TMY40@eusync3.samsung.com>; Fri, 18 Jan 2019 13:28:45 +0000 (GMT) From: Marek Szyprowski To: linux-rtc@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Alexandre Belloni , Alessandro Zummo , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH] rtc: s3c: Use generic helper to get driver data Date: Fri, 18 Jan 2019 14:28:37 +0100 Message-id: <20190118132837.15713-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLIsWRmVeSWpSXmKPExsWy7djP87p9VxxjDCZ2MFosuXiV3aL93TJ2 i40z1rNanD+/gd3i2OorbBYzzu9jslh75C67A7vHvDXVHptWdbJ59G1Zxegxfd5PJo/Pm+QC WKO4bFJSczLLUov07RK4Mo4s62Eq+M1VcW7KAdYGxhmcXYwcHBICJhJPbqh1MXJxCAmsYJR4 vHstM4TzmVHi/pdDTF2MnGBFsx8uhUosY5R48XEzO4TTwCRxZUUjK0gVm4ChRNfbLjYQW0TA QeLrn7csIEXMAu8YJfasXcMCkhAGSmy92AE2lkVAVaJn5jd2EJtXwFbi8snzUOvkJVZvOAC2 TkLgLavE+ZMr2CASLhJvWrexQ9jCEq+Ob4GyZSQ6Ow4yQTQ0M0q0z5jFDuH0MEpsnbMDqtta 4vDxi2C3MgvwSUzaNp0ZEgS8Eh1tQhAlHhKr501gBrGFBGIlLj+5zTSBUWIBI8MqRvHU0uLc 9NRio7zUcr3ixNzi0rx0veT83E2MwEg7/e/4lx2Mu/4kHWIU4GBU4uGdsMUhRog1say4MvcQ owQHs5IIL9cKxxgh3pTEyqrUovz4otKc1OJDjNIcLErivNUMD6KFBNITS1KzU1MLUotgskwc nFINjI1s0ZGVngs+/+4+8v1939/tD1W2x5o/PcKzwCYoIGF+2St39987eJ9vkqvp55059xST Q4NZyjIxi+xPPXeu1lY+UT+88bfx0xDDdLu0W//ds6LrrFNn3M/nytt3atNyIaHE8ttP9edO z7z5b0P7E8c9SV47HyySfff6f9AxDvslvHePHFh2VleJpTgj0VCLuag4EQBpQGc+sAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPJMWRmVeSWpSXmKPExsVy+t/xq7q9VxxjDNZ+FLFYcvEqu0X7u2Xs FhtnrGe1OH9+A7vFsdVX2CxmnN/HZLH2yF12B3aPeWuqPTat6mTz6NuyitFj+ryfTB6fN8kF sEZx2aSk5mSWpRbp2yVwZRxZ1sNU8Jur4tyUA6wNjDM4uxg5OSQETCRmP1zK3MXIxSEksIRR Yt/dtVBOE5PEqafTWUCq2AQMJbredrGB2CICDhJf/7xlASliFvjAKLHkwhlmkIQwUGLrxQ4m EJtFQFWiZ+Y3dhCbV8BW4vLJ80wQ6+QlVm84wDyBkWsBI8MqRpHU0uLc9NxiQ73ixNzi0rx0 veT83E2MwGDYduzn5h2MlzYGH2IU4GBU4uF9sc0hRog1say4MvcQowQHs5IIL9cKxxgh3pTE yqrUovz4otKc1OJDjNIcLErivOcNKqOEBNITS1KzU1MLUotgskwcnFINjDYHa6/9YZso0D7/ /onezgl+jEvEeheV+p15uEW95ELJ1YU2ahtvCn28mF0gF93eoPiSw3RXd8KeJ1wWv21i5BPV b+00Czp9YvanSQsa+W9Nq78SNJGz5IOzx89PZp2fP4stPzu/zCclQ+fJ9N/tkvzBExccuHV8 i6q43i1H7kX7uz4+9/D6ka/EUpyRaKjFXFScCAC0O4/0AgIAAA== X-CMS-MailID: 20190118132845eucas1p2c3e5f6dadb6af90a3701fca03599e094 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190118132845eucas1p2c3e5f6dadb6af90a3701fca03599e094 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Replace of_match_node() with of_device_get_match_data(), which removes a few lines of code from the driver. Signed-off-by: Marek Szyprowski --- drivers/rtc/rtc-s3c.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) -- 2.17.1 Reviewed-by: Krzysztof Kozlowski diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index e682977b4f6e..2904b872db88 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -443,16 +444,6 @@ static int s3c_rtc_remove(struct platform_device *pdev) return 0; } -static const struct of_device_id s3c_rtc_dt_match[]; - -static const struct s3c_rtc_data *s3c_rtc_get_data(struct platform_device *pdev) -{ - const struct of_device_id *match; - - match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node); - return match->data; -} - static int s3c_rtc_probe(struct platform_device *pdev) { struct s3c_rtc *info = NULL; @@ -472,7 +463,7 @@ static int s3c_rtc_probe(struct platform_device *pdev) } info->dev = &pdev->dev; - info->data = s3c_rtc_get_data(pdev); + info->data = of_device_get_match_data(&pdev->dev); if (!info->data) { dev_err(&pdev->dev, "failed getting s3c_rtc_data\n"); return -EINVAL;