Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp1005237rdb; Wed, 1 Nov 2023 08:46:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERkdEdkqGlYGUir/NTzZ22fOmqZCAzyahbuzPeFHdGp4py7nz+6VmRW0i1TTM4xaL21hUW X-Received: by 2002:a17:90a:2a4d:b0:27d:6dfb:405c with SMTP id d13-20020a17090a2a4d00b0027d6dfb405cmr11459545pjg.42.1698853579903; Wed, 01 Nov 2023 08:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698853579; cv=none; d=google.com; s=arc-20160816; b=FBA0TTFbFSw88sq8TPRNiVwfYlREt7a+/qfJwlhYPFHP0y0q7dq+iNuKKzw1+zOysw wZNiAz8/SyifMRdnIR/U8lW3oBvwl/9CyTR9rKFbIR7qF3Wt07CM3D1+0XHcameQlI7d Bc8r2dUM8pMkIGLWO4kXpYXibLyumkpnscT6eCoovpaPb82GqgEGOyEY2rWkaTMmFFCF KFCjSlPAJiIN9J+wGBj++ERiZSpcg/m3MvRIqKadTP19ZbSzNMkb2DK3+rcZjwMFEh8b hJWhsaWQri2M1tSJa61vnf0IQCHw+t6CASLvUJr16OB+1xibfXc9H8I9rXD2dIup1QQz n8PA== 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; bh=3jeA19kl1acYj+K5OAp8lk/hS9qxEtIjfOF2DeOY2Wk=; fh=HGXoh0Br9LbyglKQx41EKps/jGAFVzD0Or0NSzETxy0=; b=Fnw/FWSzpADFNzTzQbdAl+tSbs55Qq5Ul/BuVHa5FlhyGeROsK6ZpR+icW7RTGgkqZ nQnKUUUbD4hns8+hL8EocsSn8d0Pu56osgHIziNO74rhIXQCQZIL8bv2WdGkA4Rcs5O+ qHjNM0Th++Nu7oVH7f2Z+hLKGZMEohRkQRP6vO/YiABifQ/Ivu/OMJwRLD+aatQ9xs4F S/et1icOvA7BZ2eDLdr5xGp2nLV8GXcDPM+8ayqfdKFw25553AmxkEKSss/gyHltCqRA A+IFdZJRbSu+kcuro327uRkD4xipT6Kj4ZuzwGejLI/HY9qIzO4NtQUJ7Y/eYJm+o6jq s+Og== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id j15-20020a17090a2a8f00b002773363d105si1051977pjd.188.2023.11.01.08.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 08:46:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id CC4EB80CC117; Wed, 1 Nov 2023 08:46:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232538AbjKAPpy (ORCPT + 99 others); Wed, 1 Nov 2023 11:45:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344665AbjKAOqp (ORCPT ); Wed, 1 Nov 2023 10:46:45 -0400 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3273EDC; Wed, 1 Nov 2023 07:46:43 -0700 (PDT) Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-6ce2eaf7c2bso4523438a34.0; Wed, 01 Nov 2023 07:46:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698850002; x=1699454802; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3jeA19kl1acYj+K5OAp8lk/hS9qxEtIjfOF2DeOY2Wk=; b=oR8sOc8IS7ND8q7t6Dpf9jTtI7ICLx3r9zVXXSDumYHXKIU8LVQvbRTq9MujYec6GK DUPoVs3LVmL3CoOforCS6uflkAMK2z/H3Rk7z8tjuyuCqyS94IsammqJGa6YSGUb+ttR 5aFg9sb1Pj8EN0Yf1dDU+/VIqPgrGZAWomvNpJ6fTT/g0uAoX+hnSDKlXp0oOfx12qEW QZQ5idyNNEZtDz67h2tJfOzRKbrnxjL26jxAY1sZvRnmHcQOSH040EnHP/P1cj+SvubC yxv12qcs6eUSRW0z4NEUIWiuTRIFP5j/hBxx9pcXZmoPnZBf+aYT59gu0FZ9ufbSJZZV 7xmw== X-Gm-Message-State: AOJu0YxvPWuzedPRQTQ5/nM51hiC7gyc78VGd9JPxcUcB19Lwk3BLyGa 1tPYdkL+w20f9wHjPgUVsQ== X-Received: by 2002:a9d:6197:0:b0:6cd:da93:90ce with SMTP id g23-20020a9d6197000000b006cdda9390cemr15395286otk.19.1698850002398; Wed, 01 Nov 2023 07:46:42 -0700 (PDT) Received: from herring.priv (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id a13-20020a0568300b8d00b006b8c87551e8sm216507otv.35.2023.11.01.07.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 07:46:41 -0700 (PDT) Received: (nullmailer pid 121158 invoked by uid 1000); Wed, 01 Nov 2023 14:46:40 -0000 From: Rob Herring To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] opp: ti: Use device_get_match_data() Date: Wed, 1 Nov 2023 09:45:00 -0500 Message-ID: <20231101144501.118972-1-robh@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 08:46:12 -0700 (PDT) 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. As this driver only does DT based matching, of_match_device() will never return NULL if we've gotten to probe(). Therefore, the NULL check and error return for it can be dropped. Signed-off-by: Rob Herring --- v2: - Add missing commit msg --- 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 */ -- 2.42.0