Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1849927rdb; Mon, 9 Oct 2023 05:12:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGd8u92NctMFEGrnVuJw0KaF73IvbhsemoBy+etkI9MZmXJSBYweZ9+8izhWUPJ/FBqajmD X-Received: by 2002:a17:902:fe83:b0:1c5:bc83:556b with SMTP id x3-20020a170902fe8300b001c5bc83556bmr11638182plm.52.1696853527071; Mon, 09 Oct 2023 05:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696853527; cv=none; d=google.com; s=arc-20160816; b=eBbDfq3c4jdAccYxZr+X7sozlMSL6CSStr48+t4ual7P+v4KOZxygbj9iG+RXZCMTp OXJ+0W9pDDSzFxY5lGxRauYIwmCQPNuJW3SjFvV6DXi3c+LxKGHrq5TmJ8or0qcYfE2y D2gWm+QtzReOTeGxnlsjRMSefQTD9NxelLY55Us0ugMCt9cLJfBRVOlGHeGQwlyLBzBq Q2FZKAHpr8pBCI92UE+2zpoWR9+FO6trEAJf46fGXMuxBf/6ru/GhHWP4yPhgL31Fisq GbZJrCyVDALNA5ImKtFHmWb+QYdmc45UfkB0Q4/8cWuE5fNoncaZN4iToKC0/OIq1ZuQ ZE3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=vwfivkPUaQ/LRrt/l2l7hWR1JF88XbpoXrFKlWMP/9U=; fh=gz/7PCgDyzGoyVrMcor+mE/h4PC2c0qJ/NyO6thdYpg=; b=eVh3BxzsFc/RIIZHG4F6EqCvScSk1KBX5IxalAEWJxyjEhk3Ot818r8T8V1C0uU7FW Tv4yiOE2I8U2M1gV5089JGqlRfihjXobcwPBXE/dQQHLm6Bo3cKktOkAdOW30dohkCj4 vmRFEyleQmoqCjNRGe52r7BksPOi7UNQTvsgpMI1Rb5kqVHD+N7vqAR/3Vjh0K7WS9Sj LK5mnRoJJj0iQVgXuvcN+dzas/0esXzUONdtNJ95Ym5RaPrTVt0tV8YCVAs+LsCCZwGK +XdEjaPQRzoIXfE7T9UqJ0VnJju6hvA7c56UcvSiWKWSUXhqhsLeJujSYcmmanGw/9ce wwQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H3gaGX49; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id f12-20020a170902684c00b001c474ff2fdesi9331630pln.378.2023.10.09.05.12.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 05:12:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H3gaGX49; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id D0B53801F958; Mon, 9 Oct 2023 05:12:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376270AbjJIMLm (ORCPT + 99 others); Mon, 9 Oct 2023 08:11:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346508AbjJIMLL (ORCPT ); Mon, 9 Oct 2023 08:11:11 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF0B5101 for ; Mon, 9 Oct 2023 05:11:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 635CDC433D9 for ; Mon, 9 Oct 2023 12:11:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696853469; bh=O5Eyu+7ebS6ij1JeR18kMtBx+5nptFV99l+SE3oEw2M=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=H3gaGX49GSdZbinakE1A9jdt1T5xkva9Ny7nBfzQxKkrEAXgf+JA1eVH2LEns0xhL qZt1AAtctUlghWVP2VSwoN2aFaY+ms3g+pz53qdmCPv2UJ9tdR1ejv5FybTsHG/8Bu nC6IhLLHZjs1uwiCrvWBWP/xELDaYktpet/ZsoXLzOu9huUNx2QSNr/DN1+gv0cFVt g/TpaB4VcBYX0e7v8/F7KIZNKWQJVyT03K8wKtVGzNZxsxAqPtGllnKQjyL5ISQcI4 B21HcVK9jsyye6JtkLGzkMRCAZD+EwKADMu3ukLUCMfevbA4YBDMSwfeTT2zdgX4+X H1qppOwWT4DRA== Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-5042bfb4fe9so5344243e87.1 for ; Mon, 09 Oct 2023 05:11:09 -0700 (PDT) X-Gm-Message-State: AOJu0YxfHAa6R7591Bnv7zTESh6gvZ1SFMf+7L2xuT4oU1QlkYzvNsFs orSS/W5UCoG91FbaZkO+U2dy8kF2c+INroEovw== X-Received: by 2002:a05:6512:68a:b0:505:73e7:b478 with SMTP id t10-20020a056512068a00b0050573e7b478mr15683718lfe.16.1696853467481; Mon, 09 Oct 2023 05:11:07 -0700 (PDT) MIME-Version: 1.0 References: <20231006224402.442078-1-robh@kernel.org> In-Reply-To: From: Rob Herring Date: Mon, 9 Oct 2023 07:10:54 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] memory: Use device_get_match_data() To: Krzysztof Kozlowski Cc: Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Florian Fainelli , Broadcom internal kernel review list , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 09 Oct 2023 05:12:03 -0700 (PDT) X-Spam-Level: ** On Sun, Oct 8, 2023 at 6:33=E2=80=AFAM Krzysztof Kozlowski wrote: > > On 07/10/2023 00:44, Rob Herring wrote: > > 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 > > --- > > ... > > > enum ccf_version { > > CCF1, > > @@ -172,14 +170,9 @@ static irqreturn_t ccf_irq(int irq, void *dev_id) > > static int ccf_probe(struct platform_device *pdev) > > { > > struct ccf_private *ccf; > > - const struct of_device_id *match; > > u32 errinten; > > int ret, irq; > > > > - match =3D of_match_device(ccf_matches, &pdev->dev); > > - if (WARN_ON(!match)) > > - return -ENODEV; > > - > > ccf =3D devm_kzalloc(&pdev->dev, sizeof(*ccf), GFP_KERNEL); > > if (!ccf) > > return -ENOMEM; > > @@ -189,7 +182,7 @@ static int ccf_probe(struct platform_device *pdev) > > return PTR_ERR(ccf->regs); > > > > ccf->dev =3D &pdev->dev; > > - ccf->info =3D match->data; > > + ccf->info =3D device_get_match_data(&pdev->dev); > > This part is no equivalent. You miss here if (WARN_ON(!ccf->info)). Checking for match failed was pointless. We already matched in order to probe and DT is the only way we match. Rob