From patchwork Mon Oct 9 17:29:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 150231 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp2022287vqo; Mon, 9 Oct 2023 10:33:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYHugdT0hcPDOxvoNsGJecNJumspV0GvWqli01czELGHt+xsRyfRgrK7Hmc+NVngZTqszY X-Received: by 2002:a05:6830:1bc7:b0:6bd:c8c2:b70f with SMTP id v7-20020a0568301bc700b006bdc8c2b70fmr15891329ota.34.1696872783211; Mon, 09 Oct 2023 10:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696872783; cv=none; d=google.com; s=arc-20160816; b=lKoXvQwEZAj/z13xeVCnUtAoLAjr0xdOkxd8IFB0qrer85oa0o/Zp1k7moW6xiC/7r mOXVficKajm6KADda7I4EDXVUITULCKU0Pq+J7l3qS7cPw70oueTG1oV+vKzcMLB1M4a G8KCk3A3l8E02iIoue0I4PCqJ8hROPgs84YIgAf7vMgn9UNtcNGv+7sOaZVaRYlpI1BZ ShU27ArOJPu1Qsik21ijv8cI49pi5L6sI6HL+yXsvpFa5+r9QsZHB4t7x04ncgFjyFSu Srflxr77fu6WxLmrcdEN1jE0DbFF2XiW7T3rkbiAjC0u7yNMRhqL5zfgqkfZ3OQTCyqY r51g== 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=bonHmR4fbjmc64kWSY8Ujz6X/PEeEcKaN4Sq4MHNuq4=; fh=HGXoh0Br9LbyglKQx41EKps/jGAFVzD0Or0NSzETxy0=; b=yGwo7HEiRkt0vVs/tILeijf1mD8P7kgEiZ8TNzT5OisPQQXzGr+c3HNMSeeEcDj5QT sJRyaUIVS7h+Q/OMaXxBiwLOa+InnyeIzwvMxlq3AN57NtnomuV2qCNsNO9cb0eksyaY 52g8GC3GPZbQHR9EteGoZElWES6FS2HigS+ix6FvfAEIXzRc9rnBM+TyzZQGVlmdWhPT Vn+1Ep/OKEmCpQ8oRaHiSVBtj3pDy0b5IrDTlpTl4pKXj+o3T4X7xtzdYqdIDdtKYkFh xbQix2d1hNFYFiLK1UkN+jkL3O6lQhp8PzbOpa2yrW710lhXPbc1SYs0LTx88onBczT+ D7jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uEcN4iqp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id v11-20020a63f20b000000b0057748a05fcfsi9832843pgh.27.2023.10.09.10.33.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 10:33:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uEcN4iqp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id F3EFD802A337; Mon, 9 Oct 2023 10:32:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378013AbjJIRcj (ORCPT + 18 others); Mon, 9 Oct 2023 13:32:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377997AbjJIRcd (ORCPT ); Mon, 9 Oct 2023 13:32:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 531ADB6; Mon, 9 Oct 2023 10:32:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 414E0C433C7; Mon, 9 Oct 2023 17:32:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696872748; bh=hOqxwwj4R1P+EKnufjhjvIS/kNuMb6T35WWc1dRZ9O4=; h=From:To:Cc:Subject:Date:From; b=uEcN4iqpBBPTXSuTJmmsQW0XBmgffVYlQgaBjmqqdTkRMVBG3BPa8lkOyWVCiwydU 3UuptraJO6PiL4/jHqCtCVy7SBukoRQZkIpSXQM74DtScLLZeIn6rEoAdqqv44LPlq hTyApjxodLZmzbOPa81Mzs0EvyUJ1mMNGXa2ZCpkIb0AhuQGzdOkz6h/wsixIaX67b AqDMNmUTbTAFH+gmagJH7m1KciVoh8iecrwwuRs7IDflPBSn6msD4mUb4WKZscDXo3 ZVBsOTMkYpgYhuo0I8Fi1xNzkEWqhft5b3tfUaMhb7EkdATxM03er2qwuR78FSd7FX 1lhz54xTAGRjg== Received: (nullmailer pid 2526325 invoked by uid 1000); Mon, 09 Oct 2023 17:32:27 -0000 From: Rob Herring To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] opp: ti: Use device_get_match_data() Date: Mon, 9 Oct 2023 12:29:08 -0500 Message-ID: <20231009172923.2457844-13-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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 09 Oct 2023 10:32:57 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779300075383707001 X-GMAIL-MSGID: 1779300075383707001 Signed-off-by: Rob Herring --- drivers/opp/ti-opp-supply.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/opp/ti-opp-supply.c b/drivers/opp/ti-opp-supply.c index 8f3f13fbbb25..e3b97cd1fbbf 100644 --- a/drivers/opp/ti-opp-supply.c +++ b/drivers/opp/ti-opp-supply.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -373,23 +374,15 @@ static int ti_opp_supply_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device *cpu_dev = get_cpu_device(0); - const struct of_device_id *match; const struct ti_opp_supply_of_data *of_data; int ret = 0; - match = of_match_device(ti_opp_supply_of_match, dev); - if (!match) { - /* We do not expect this to happen */ - dev_err(dev, "%s: Unable to match device\n", __func__); - return -ENODEV; - } - if (!match->data) { + of_data = device_get_match_data(dev); + if (!of_data) { /* Again, unlikely.. but mistakes do happen */ dev_err(dev, "%s: Bad data in match\n", __func__); return -EINVAL; } - of_data = match->data; - dev_set_drvdata(dev, (void *)of_data); /* If we need optimized voltage */