Message ID | 20231029114843.15553-1-peter.ujfalusi@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp1643668vqb; Sun, 29 Oct 2023 04:49:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLQJ3flS3epLRLD1q2d+ZjrbS5JKdV50AOsdak3cr1ju2+vTFVztpGZNy+jp1LUgKwgGD5 X-Received: by 2002:a05:6a00:2d95:b0:68e:3616:604a with SMTP id fb21-20020a056a002d9500b0068e3616604amr9467247pfb.8.1698580139988; Sun, 29 Oct 2023 04:48:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698580139; cv=none; d=google.com; s=arc-20160816; b=OStYEHgVe5ge48wEw6+pBmpMbBqrB9wLUZVDDkdLzUQN5RxMtBRprBBzrTFrvy5Hog lvMA6RDq4hKST3tG2x+wNMbJXPPvs1MXGOCjxC2/hta8vtrccZP8/fjTLQiP87xdEJeo YZDQW9CVZAW9XO5bkgyIJDHQ+7651tioqyL4TTgnReY1DE4VokixRXWHeDD4Xed2lsav cd1ttiVgG/gRMYupL3NqWVh+CB6qvUu0A1tKcjh01yMbFOCQa2Z9oSmFDZtF+PBcc1r/ 1Np+seBpyQapieVUuVq1eogNoICkxyfxCcDj+SqQJEGN0lIDi2eC3Pth4jBcqd7YAB6X HzVA== 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=d+v+Jv8cNfs1h2ATuX1rQpWp90XwNnzcTm+maLE/WR8=; fh=lyM3fRd5oHvigCXKQzjWd1gxAEns07NVcHHP24DeLj8=; b=df+uejTIYewPgmpzK9Bx/SaxWJrOlIEH+ulqgEIcG+SPZmWxXzML37woglFTe1gAVa mjn/EbdB0XkZwm4+hcwdvwsvP/JKQ4YwVesUXj5EZxcbfazjd16hqeslnr9o/vmVER7k 1aSZtMhyss8IpWAsUza51w80NvRM4LdT0UvzynHwmzX+GKlcC0Rl96RvgAMrWXgbnk1z jA1bHhPevQoCBzT+Olbd0FLNf6YkB/ioS2v85qkG82KHMz30RCEzyY9qWC3YPHbRSwRQ ygVrbK2UaoeemNlS1FKtTJarjhSXzf0K576rhT01xMB4HLANmSEupf0BUsBsrpm9vyKp GA+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=B926cCAe; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id v190-20020a6389c7000000b005b928c7b284si3577669pgd.587.2023.10.29.04.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 04:48:59 -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=@gmail.com header.s=20230601 header.b=B926cCAe; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 749FB808EDF3; Sun, 29 Oct 2023 04:48:57 -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 S229730AbjJ2LsU (ORCPT <rfc822;fengqi706@gmail.com> + 30 others); Sun, 29 Oct 2023 07:48:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjJ2LsS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 29 Oct 2023 07:48:18 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FCB6BC; Sun, 29 Oct 2023 04:48:16 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-509109104e2so1205117e87.3; Sun, 29 Oct 2023 04:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698580094; x=1699184894; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=d+v+Jv8cNfs1h2ATuX1rQpWp90XwNnzcTm+maLE/WR8=; b=B926cCAe3lfEz2qRCjhiHuqd9aFUPWwSGXLruEdunIHN7F1jPu7p9aBZmQmgh0b0GE Fyl3c2GmIKWdIlwFXk8nCLIsUGtlX6i44QBTeOaAxahJsObO1MH238Sz5BSB9SUd5Ete EPNTsQBTbGTp8HCMynwpu0afj8Dzz2ZoovEQF4jG5AjCilN5z2uLHW5kqVt5FebbFhX4 V/hFQ6RY4MsAz6xz455iF/ez3TzgN5KgmWZeirIEiQj9xEKTM+nqPyoKfQ6xD4sMOVlh Ttw5a8Hf2LAJZqDvJUqBtmGcPmyskqM0g854vGfM2poWEUsbY3NcwWEZ3tYdwF02TALH tmBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698580094; x=1699184894; 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=d+v+Jv8cNfs1h2ATuX1rQpWp90XwNnzcTm+maLE/WR8=; b=k0qt9Xq4S2AhuPglYsFArXiVsuWHWQBsPIU7cJxyE8z7sfMp/eCUDAjO2ymmOmQIxl EW5ASWFgJN3kNN0pOG0hX2ZbECzS6rcQRB4pLEdaV5Rv0iu+Da97njfEDqQupdAEDYnu 5Nui2O8lfhUFCrVpFXBx9uBz4dwTXg/w1XRNIKs0VChLf0hDRRSA/AI9p7/oQCcDMIB8 7l456bX2HzQcEZ3N5C1FPCi85EQMIZb0XF0PQkd3K+6WdFYrAIS93hbcoRfHbl5juwOC 766Fh78k8NbAPwmStegPg6BiWtcrI4mKnJW36xqqB8AM8KcSpfHRyOM2P9xyz4+C14N2 ceow== X-Gm-Message-State: AOJu0YxaAAZ6L+iqFZcoKOq3XKMG1/yBY/UukHfVoJigtUDS0n2rU8+U eXUyqO9zEpuWBiBvCqtLRz1vC1kqdGs= X-Received: by 2002:a05:6512:2082:b0:507:b15b:8b99 with SMTP id t2-20020a056512208200b00507b15b8b99mr4396479lfr.60.1698580094240; Sun, 29 Oct 2023 04:48:14 -0700 (PDT) Received: from localhost.localdomain (host-213-145-197-219.kaisa-laajakaista.fi. [213.145.197.219]) by smtp.gmail.com with ESMTPSA id 27-20020ac2483b000000b00502e0388846sm1016346lft.244.2023.10.29.04.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 04:48:13 -0700 (PDT) From: Peter Ujfalusi <peter.ujfalusi@gmail.com> To: tony@atomide.com, lee@kernel.org, robh@kernel.org Cc: wens@csie.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mfd: twl6030-irq: Revert to use of_match_device() Date: Sun, 29 Oct 2023 13:48:43 +0200 Message-ID: <20231029114843.15553-1-peter.ujfalusi@gmail.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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: <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 (fry.vger.email [0.0.0.0]); Sun, 29 Oct 2023 04:48:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781090368719312638 X-GMAIL-MSGID: 1781090368719312638 |
Series |
mfd: twl6030-irq: Revert to use of_match_device()
|
|
Commit Message
Péter Ujfalusi
Oct. 29, 2023, 11:48 a.m. UTC
The core twl chip is probed via i2c and the dev->driver->of_match_table is
NULL, causing the driver to fail to probe.
This partially reverts commit 1e0c866887f4.
Fixes: 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
---
drivers/mfd/twl6030-irq.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Comments
On Sun, 29 Oct 2023, Peter Ujfalusi wrote: > The core twl chip is probed via i2c and the dev->driver->of_match_table is > NULL, causing the driver to fail to probe. > > This partially reverts commit 1e0c866887f4. > > Fixes: 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers") > Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com> > --- > drivers/mfd/twl6030-irq.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c > index f9fce8408c2c..3c03681c124c 100644 > --- a/drivers/mfd/twl6030-irq.c > +++ b/drivers/mfd/twl6030-irq.c > @@ -24,10 +24,10 @@ > #include <linux/kthread.h> > #include <linux/mfd/twl.h> > #include <linux/platform_device.h> > -#include <linux/property.h> > #include <linux/suspend.h> > #include <linux/of.h> > #include <linux/irqdomain.h> > +#include <linux/of_device.h> > > #include "twl-core.h" > > @@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num) > int nr_irqs; > int status; > u8 mask[3]; > - const int *irq_tbl; > + const struct of_device_id *of_id; > > - irq_tbl = device_get_match_data(dev); > - if (!irq_tbl) { > + of_id = of_match_device(twl6030_of_match, dev); I think you just dropped support for ACPI. Rob, care to follow-up? > + if (!of_id || !of_id->data) { > dev_err(dev, "Unknown TWL device model\n"); > return -EINVAL; > } > @@ -409,7 +409,7 @@ int twl6030_init_irq(struct device *dev, int irq_num) > > twl6030_irq->pm_nb.notifier_call = twl6030_irq_pm_notifier; > atomic_set(&twl6030_irq->wakeirqs, 0); > - twl6030_irq->irq_mapping_tbl = irq_tbl; > + twl6030_irq->irq_mapping_tbl = of_id->data; > > twl6030_irq->irq_domain = > irq_domain_add_linear(node, nr_irqs, > -- > 2.42.0 >
On Thu, 23 Nov 2023, Lee Jones wrote: > On Sun, 29 Oct 2023, Peter Ujfalusi wrote: > > > The core twl chip is probed via i2c and the dev->driver->of_match_table is > > NULL, causing the driver to fail to probe. > > > > This partially reverts commit 1e0c866887f4. > > > > Fixes: 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers") > > Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com> > > --- > > drivers/mfd/twl6030-irq.c | 10 +++++----- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c > > index f9fce8408c2c..3c03681c124c 100644 > > --- a/drivers/mfd/twl6030-irq.c > > +++ b/drivers/mfd/twl6030-irq.c > > @@ -24,10 +24,10 @@ > > #include <linux/kthread.h> > > #include <linux/mfd/twl.h> > > #include <linux/platform_device.h> > > -#include <linux/property.h> > > #include <linux/suspend.h> > > #include <linux/of.h> > > #include <linux/irqdomain.h> > > +#include <linux/of_device.h> > > > > #include "twl-core.h" > > > > @@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num) > > int nr_irqs; > > int status; > > u8 mask[3]; > > - const int *irq_tbl; > > + const struct of_device_id *of_id; > > > > - irq_tbl = device_get_match_data(dev); > > - if (!irq_tbl) { > > + of_id = of_match_device(twl6030_of_match, dev); > > I think you just dropped support for ACPI. Ah, scrap that. I was looking at the wrong part of 1e0c866887f4. So what about the other drivers changed in the aforementioned commit? Ideally we'd have a call that covers all of the various probing APIs. > Rob, care to follow-up? I'd still like Rob to comment.
On 23/11/2023 12:41, Lee Jones wrote: >>> @@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num) >>> int nr_irqs; >>> int status; >>> u8 mask[3]; >>> - const int *irq_tbl; >>> + const struct of_device_id *of_id; >>> >>> - irq_tbl = device_get_match_data(dev); >>> - if (!irq_tbl) { >>> + of_id = of_match_device(twl6030_of_match, dev); >> >> I think you just dropped support for ACPI. > > Ah, scrap that. I was looking at the wrong part of 1e0c866887f4. > > So what about the other drivers changed in the aforementioned commit? Looking back at it again, I think only this patch is needed. This is not a real driver, it is using the twl core's device. The twl6030 is for sure broken, let me reply to the twl4030-power in a sec. > Ideally we'd have a call that covers all of the various probing APIs. > >> Rob, care to follow-up? > > I'd still like Rob to comment. >
On Thu, 23 Nov 2023, Péter Ujfalusi wrote: > > > On 23/11/2023 12:41, Lee Jones wrote: > >>> @@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num) > >>> int nr_irqs; > >>> int status; > >>> u8 mask[3]; > >>> - const int *irq_tbl; > >>> + const struct of_device_id *of_id; > >>> > >>> - irq_tbl = device_get_match_data(dev); > >>> - if (!irq_tbl) { > >>> + of_id = of_match_device(twl6030_of_match, dev); > >> > >> I think you just dropped support for ACPI. > > > > Ah, scrap that. I was looking at the wrong part of 1e0c866887f4. > > > > So what about the other drivers changed in the aforementioned commit? > > Looking back at it again, I think only this patch is needed. > This is not a real driver, it is using the twl core's device. > The twl6030 is for sure broken, let me reply to the twl4030-power in a sec. > > > Ideally we'd have a call that covers all of the various probing APIs. > > > >> Rob, care to follow-up? Rob, last chance to state your case before I apply it.
On Sun, 29 Oct 2023 13:48:43 +0200, Peter Ujfalusi wrote: > The core twl chip is probed via i2c and the dev->driver->of_match_table is > NULL, causing the driver to fail to probe. > > This partially reverts commit 1e0c866887f4. > > Applied, thanks! [1/1] mfd: twl6030-irq: Revert to use of_match_device() commit: 6caa120c47c6f8ccb94c4a1d47e44c17de04057a -- Lee Jones [李琼斯]
On Okt 29 2023, Peter Ujfalusi wrote: > The core twl chip is probed via i2c and the dev->driver->of_match_table is > NULL, causing the driver to fail to probe. > > This partially reverts commit 1e0c866887f4. > > Fixes: 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers") That commit id does not exist, which is why it hasn't been picked up by stable. The correct commit id is 830fafce06e6f.
On Mon, 19 Feb 2024, Andreas Schwab wrote: > On Okt 29 2023, Peter Ujfalusi wrote: > > > The core twl chip is probed via i2c and the dev->driver->of_match_table is > > NULL, causing the driver to fail to probe. > > > > This partially reverts commit 1e0c866887f4. > > > > Fixes: 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers") > > That commit id does not exist, which is why it hasn't been picked up by > stable. The correct commit id is 830fafce06e6f. It hasn't been picked by Stable because no one sent it to Stable. :)
* Lee Jones <lee@kernel.org> [240219 14:33]: > On Mon, 19 Feb 2024, Andreas Schwab wrote: > > > On Okt 29 2023, Peter Ujfalusi wrote: > > > > > The core twl chip is probed via i2c and the dev->driver->of_match_table is > > > NULL, causing the driver to fail to probe. > > > > > > This partially reverts commit 1e0c866887f4. > > > > > > Fixes: 1e0c866887f4 ("mfd: Use device_get_match_data() in a bunch of drivers") > > > > That commit id does not exist, which is why it hasn't been picked up by > > stable. The correct commit id is 830fafce06e6f. > > It hasn't been picked by Stable because no one sent it to Stable. :) Andreas, can you please send an email asking stable to pick it up? See Documentation/process/stable-kernel-rules.rst for details. Regards, Tony
diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c index f9fce8408c2c..3c03681c124c 100644 --- a/drivers/mfd/twl6030-irq.c +++ b/drivers/mfd/twl6030-irq.c @@ -24,10 +24,10 @@ #include <linux/kthread.h> #include <linux/mfd/twl.h> #include <linux/platform_device.h> -#include <linux/property.h> #include <linux/suspend.h> #include <linux/of.h> #include <linux/irqdomain.h> +#include <linux/of_device.h> #include "twl-core.h" @@ -368,10 +368,10 @@ int twl6030_init_irq(struct device *dev, int irq_num) int nr_irqs; int status; u8 mask[3]; - const int *irq_tbl; + const struct of_device_id *of_id; - irq_tbl = device_get_match_data(dev); - if (!irq_tbl) { + of_id = of_match_device(twl6030_of_match, dev); + if (!of_id || !of_id->data) { dev_err(dev, "Unknown TWL device model\n"); return -EINVAL; } @@ -409,7 +409,7 @@ int twl6030_init_irq(struct device *dev, int irq_num) twl6030_irq->pm_nb.notifier_call = twl6030_irq_pm_notifier; atomic_set(&twl6030_irq->wakeirqs, 0); - twl6030_irq->irq_mapping_tbl = irq_tbl; + twl6030_irq->irq_mapping_tbl = of_id->data; twl6030_irq->irq_domain = irq_domain_add_linear(node, nr_irqs,