Message ID | 20231115210245.3744589-1-robh@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2809968vqg; Wed, 15 Nov 2023 13:04:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGYaHe1domfZgP5GNyMl3UvbxjMaos5ejXgqWCjI3ZAPPzmdXu7gymSzei6x+iL4kSYjbxK X-Received: by 2002:a05:6808:159d:b0:3b6:dc6f:271c with SMTP id t29-20020a056808159d00b003b6dc6f271cmr17028706oiw.48.1700082253605; Wed, 15 Nov 2023 13:04:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700082253; cv=none; d=google.com; s=arc-20160816; b=lmh6YwzARcxyuh7rUPCXbIwtA+m/nwu4SWJq75WoRb/Sx031aQvTBw08vwVHXy+099 xCF1oEW8anaxLJqRpy2a+0i6Ax0lHAqEDsWOd1JXEMcuuH02PzzlUm359AQiXoDUszwg 4sWqI0NzaNHufh5VJB1CKX7Q+ZOXeRKIyIInNr6FFTqouGr4EBdcR/VdKK1sigZOXQg+ Czo4LpP3bZutpXt7qyvrsv1sidbLYoz2YgY/HgPcOB7SSYIENUhwJZtH/QvmE3DugEHJ kjmL9T7tNzvVafuTJrB+cwuFudlktUGZy2kOeSVdijlu58V8d3NkpkQ4t/C0OShavv4q 7I9Q== 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=pqS2umDahExgvUp9vYjVtRrP0HXmO16NeUGqzSCCh8k=; fh=20aOYVgk5DcgGovGVFzHDmn12Lh87kfrBX3nFB/aKCQ=; b=nZp/zBT8G/WV/KFZiZvl/vHtvFHj32yj9GdYozRhprtNl/UVkyoV9AF8atastnl0HQ kKUdDdfHl+ytb2VyXXPMS44jHV8AwfpxnAEImSoiSQJH/GpgcE8cV1UcLUhQ2ROU0CUR Cyjj/jOpb9OObuBKEjchd+B8ABao2V44DH5WJLRoOMr8oUQ5wcgebV4x2em5xuNXq2cj 8B+HfcIDFfUx3fugRM15rNB5assKBzfv4lUnJUiYrGCRJK4Aw7AqCGGqFfMMqZ+iIIr6 97BjoynckFNJ7eqKopfgU74LTXaEwpVNoqYL3wXpBVaJsGvXGZdmfAAR/evdTEOFAYzS hvbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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. [23.128.96.32]) by mx.google.com with ESMTPS id l11-20020a65680b000000b005b7c7eee133si10531515pgt.687.2023.11.15.13.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 13:04:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 3EF7680CA0A6; Wed, 15 Nov 2023 13:04:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344793AbjKOVDg (ORCPT <rfc822;lhua1029@gmail.com> + 29 others); Wed, 15 Nov 2023 16:03:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344738AbjKOVDJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Nov 2023 16:03:09 -0500 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AADDEAB for <linux-kernel@vger.kernel.org>; Wed, 15 Nov 2023 13:02:56 -0800 (PST) Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-1e9c42fc0c9so27126fac.1 for <linux-kernel@vger.kernel.org>; Wed, 15 Nov 2023 13:02:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700082176; x=1700686976; 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=pqS2umDahExgvUp9vYjVtRrP0HXmO16NeUGqzSCCh8k=; b=G0xULteVwLcZRCu+qHpibkXEQLcCiwVFREWyero8Zgp+/mgjqiXkL/Wuu25FGz+oGd 7+FWTMjGjgBJE2e91oL5mvFTas6mSt6/klJdSXjUsSGG9BCwVxzWrlzxQbHSzBtQDuuB /591K5ohABLUuzh9ZgUiTlu+cNPhZGayp2+UQgnggmjgR6jeKhOCuwZbXu7tTRMpIxQP 2n83Ecr6oOyaRslsobwRgNUTYQ3M4V9PDQHlr6DSr9NYb9gVQY2Rr5WkdEKscQNMXkws OnBqkKu+uzBlyYmQWscIoZwH6Z9rTfwtdBU4AwxpgBhPfNjvKG/q+wzAUzZJiY5bKw+N CiUw== X-Gm-Message-State: AOJu0YwvjlXal4EQ4UeKkVvcPxBnH1Cs3du372gQ0SqxIV5YnmzsBr12 19w7I+Cj39/DCl+pX5h4Q6vD5FV7kg== X-Received: by 2002:a05:6870:8895:b0:1ef:b16f:d29d with SMTP id m21-20020a056870889500b001efb16fd29dmr15609299oam.18.1700082175882; Wed, 15 Nov 2023 13:02:55 -0800 (PST) Received: from herring.priv (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id g6-20020a0568300a4600b006ce28044207sm690053otu.58.2023.11.15.13.02.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 13:02:54 -0800 (PST) Received: (nullmailer pid 3744821 invoked by uid 1000); Wed, 15 Nov 2023 21:02:53 -0000 From: Rob Herring <robh@kernel.org> To: Paul Burton <paulburton@kernel.org>, Miguel Ojeda <ojeda@kernel.org> Cc: linux-kernel@vger.kernel.org Subject: [RESEND PATCH] auxdisplay: img-ascii-lcd: Use device_get_match_data() Date: Wed, 15 Nov 2023 15:02:44 -0600 Message-ID: <20231115210245.3744589-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 agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> 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]); Wed, 15 Nov 2023 13:04:11 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782665449237883900 X-GMAIL-MSGID: 1782665449237883900 |
Series |
[RESEND] auxdisplay: img-ascii-lcd: Use device_get_match_data()
|
|
Commit Message
Rob Herring
Nov. 15, 2023, 9:02 p.m. UTC
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 <robh@kernel.org>
---
drivers/auxdisplay/img-ascii-lcd.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
Comments
On Wed, Nov 15, 2023 at 10:02 PM Rob Herring <robh@kernel.org> wrote: > > + cfg = device_get_match_data(&pdev->dev); This sounds good to me, but a couple notes: - This could be `dev` since we have it, no? - Orthogonally, should we just directly initialize `cfg` since now we can? Cc'ing Geert as well since he was the last one touching the file (in fact, he added the `dev` variable). Cheers, Miguel
Hi Miguel, On Thu, Nov 30, 2023 at 7:55 PM Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote: > On Wed, Nov 15, 2023 at 10:02 PM Rob Herring <robh@kernel.org> wrote: > > + cfg = device_get_match_data(&pdev->dev); > > This sounds good to me, but a couple notes: > > - This could be `dev` since we have it, no? Indeed. > - Orthogonally, should we just directly initialize `cfg` since now we can? Yes we can, it would still fit on an 80-column punched card ;-) Gr{oetje,eeting}s, Geert
On Thu, Nov 30, 2023 at 12:55 PM Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote: > > On Wed, Nov 15, 2023 at 10:02 PM Rob Herring <robh@kernel.org> wrote: > > > > + cfg = device_get_match_data(&pdev->dev); > > This sounds good to me, but a couple notes: > > - This could be `dev` since we have it, no? > > - Orthogonally, should we just directly initialize `cfg` since now we can? > > Cc'ing Geert as well since he was the last one touching the file (in > fact, he added the `dev` variable). Can you fix that up while applying? This patch has only been ignored for 2 months. I really only care about getting the includes right so I can apply this[1]. Rob [1] https://lore.kernel.org/all/20231129164316.2663565-1-robh@kernel.org/
On Fri, Dec 1, 2023 at 2:39 PM Rob Herring <robh@kernel.org> wrote: > > Can you fix that up while applying? This patch has only been ignored > for 2 months. > > I really only care about getting the includes right so I can apply this[1]. Then I would recommend saying that in the patch itself. If you want to take it in your series to go faster, you can take my: Acked-by: Miguel Ojeda <ojeda@kernel.org> If you want me to apply it, that is also fine and I can do so. Cheers, Miguel
On Fri, Dec 1, 2023 at 7:50 AM Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote: > > On Fri, Dec 1, 2023 at 2:39 PM Rob Herring <robh@kernel.org> wrote: > > > > Can you fix that up while applying? This patch has only been ignored > > for 2 months. > > > > I really only care about getting the includes right so I can apply this[1]. > > Then I would recommend saying that in the patch itself. > > If you want to take it in your series to go faster, you can take my: > > Acked-by: Miguel Ojeda <ojeda@kernel.org> > > If you want me to apply it, that is also fine and I can do so. Please take it. There's other dependencies already, so I'll be sending the final patch to Linus at the end of the merge window or after rc1. Rob
On Fri, Dec 1, 2023 at 3:20 PM Rob Herring <robh@kernel.org> wrote: > > Please take it. There's other dependencies already, so I'll be sending > the final patch to Linus at the end of the merge window or after rc1. Applied, thanks! Paul: please double-check/test it (I just compile-tested it) and shout if you do not agree with the change. Otherwise, I will send it to Linus for the next merge window. https://github.com/ojeda/linux/commit/c52391fafcefe4c562bdac62088a2735c185b942 Cheers, Miguel
diff --git a/drivers/auxdisplay/img-ascii-lcd.c b/drivers/auxdisplay/img-ascii-lcd.c index fa23e415f260..c16a14becdfc 100644 --- a/drivers/auxdisplay/img-ascii-lcd.c +++ b/drivers/auxdisplay/img-ascii-lcd.c @@ -8,9 +8,9 @@ #include <linux/io.h> #include <linux/mfd/syscon.h> #include <linux/module.h> -#include <linux/of_address.h> -#include <linux/of_platform.h> +#include <linux/of.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/regmap.h> #include <linux/slab.h> @@ -225,17 +225,12 @@ MODULE_DEVICE_TABLE(of, img_ascii_lcd_matches); */ static int img_ascii_lcd_probe(struct platform_device *pdev) { - const struct of_device_id *match; const struct img_ascii_lcd_config *cfg; struct device *dev = &pdev->dev; struct img_ascii_lcd_ctx *ctx; int err; - match = of_match_device(img_ascii_lcd_matches, dev); - if (!match) - return -ENODEV; - - cfg = match->data; + cfg = device_get_match_data(&pdev->dev); ctx = devm_kzalloc(dev, sizeof(*ctx) + cfg->num_chars, GFP_KERNEL); if (!ctx) return -ENOMEM;