From patchwork Mon Oct 9 21:13:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 150340 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp2125144vqo; Mon, 9 Oct 2023 14:16:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGoAQ5zQL6y3hT2fy9u/XP5M35KzcoaNfX0ABlG9GPZg489VU9CGMbo0fa63xhD4VAqGASe X-Received: by 2002:a17:90b:33c2:b0:279:1b8f:a995 with SMTP id lk2-20020a17090b33c200b002791b8fa995mr13385720pjb.45.1696886169844; Mon, 09 Oct 2023 14:16:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696886169; cv=none; d=google.com; s=arc-20160816; b=LEkr0Id8gUZZVkkLkqBKnCDBHxkffltO7HSrAwt/Sf+GxXcMQCbbaUVB4SnC9tc0t1 Evoj44BfFVeM205AkTTOceWUrKYfENdCAnW3Kt3JjzRcin2v9JM0A9JbLMqMZ50bJWuW PsWfFTyQe2PQYShtFFbTKbYaP04tFKpbLZNrSvH8QZo+UBCQWs6OTh840UxHSHOrKB80 dKBp8XauWUw1SJtDrHO0qsutsS9ojf82YxUhzA9Pa1oEZhE490ZCQf1Bg0Kmla2T9vsB p3JYBpH6+xV+zpkr+PzEn4HhdUXAD4L3RWefjG+C2AlPijp7R/10FsNMNxqqkyJ5lCRa j5tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=jBIIImlOS553o2bnHEGOjYNeMkvNqdWTYPNiD6viPc0=; fh=//sNr2h0DsItKXoOjThmkRviLS89ji0BittNmy8tjaY=; b=j9Ahfwp4TXdq929SlAinnhKFOv6aeZB/ooL9s/IPcd4fjTlXQ/IcluBqqCt7QOnIxH AlXzGHl6l9lf2u4pDdTcwx39N+FhJwuackP5aMyzy/DVHOsjGk6XGWuJ0umMoRXioZvh YSyEHN0MEVtMtXP1UR5fRwfK7cBVIed0YRaBKkfAcyfwN4s0IIcN4Iq4QEHt352n7Y6y YaflQMgL40jfypQUUZ1uCj48LTNZTIPWZbHRxrnDWb+Vvix0CbFf/30HL3rZ44U38GYI GRJyjGTbZafNU+O+DcF9soVdg+PASdIcmYzDNzVi8PeSGjTwS6YF6lnWJv1O08kn/sox uplw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZZGGPv8Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id v4-20020a17090ad58400b0027728f01512si10166058pju.167.2023.10.09.14.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 14:16:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZZGGPv8Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C1BCB8042399; Mon, 9 Oct 2023 14:16:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378835AbjJIVPa (ORCPT + 19 others); Mon, 9 Oct 2023 17:15:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378801AbjJIVO7 (ORCPT ); Mon, 9 Oct 2023 17:14:59 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E378BFD for ; Mon, 9 Oct 2023 14:14:34 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E3B9C433CB; Mon, 9 Oct 2023 21:14:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696886074; bh=ESmiH/TEMoyx2a7FlX65mUwzXaBIM0ko/o8gmuHHSoo=; h=From:To:Cc:Subject:Date:From; b=ZZGGPv8QSL2rXh+PxVZvekJ/yuCN1VFSLEc6tXQOTwetm5HnA7ds3y1wIY5M4MFmc IEsixsfZBC9jQmqsIWRIFeMaO2bVmZ20Jo5sKT2I/VLE4HOMKflQsPekscqYoQLeYn g19UzVvIb+iH7kIwnnwCFo8H8/GVVjYyS2Xkq1MVPg57e5pk9iqjpyHNEdavd+UQ5f 1b4Ql9ZUueL3emkuU2N4q/utxrQhHks5VjKvLRuweDt7tkBeyAgFQiXmJHL4lsM0Uu Np/IHyxjMvCbvOvOuVAPir61fSQGmMyD1q/F47sTZG2Q+oaGfIZ0IfMPoR0Be4rQW+ 4n7YjbV4LfsjA== Received: (nullmailer pid 3246161 invoked by uid 1000); Mon, 09 Oct 2023 21:14:13 -0000 From: Rob Herring To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rtc: omap: Use device_get_match_data() Date: Mon, 9 Oct 2023 16:13:42 -0500 Message-ID: <20231009211356.3242037-12-robh@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 09 Oct 2023 14:16:06 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779314112599090428 X-GMAIL-MSGID: 1779314112599090428 Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring --- drivers/rtc/rtc-omap.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index 5b10ab06cd2e..c6155c48a4ac 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -18,12 +18,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include @@ -729,16 +729,14 @@ static int omap_rtc_probe(struct platform_device *pdev) struct omap_rtc *rtc; u8 reg, mask, new_ctrl; const struct platform_device_id *id_entry; - const struct of_device_id *of_id; int ret; rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL); if (!rtc) return -ENOMEM; - of_id = of_match_device(omap_rtc_of_match, &pdev->dev); - if (of_id) { - rtc->type = of_id->data; + rtc->type = device_get_match_data(&pdev->dev); + if (rtc->type) { rtc->is_pmic_controller = rtc->type->has_pmic_mode && of_device_is_system_power_controller(pdev->dev.of_node); } else {