From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92557C5AD4C for ; Thu, 23 Nov 2023 10:38:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344590AbjKWKh5 (ORCPT ); Thu, 23 Nov 2023 05:37:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229844AbjKWKhz (ORCPT ); Thu, 23 Nov 2023 05:37:55 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD0B01BD for ; Thu, 23 Nov 2023 02:38:01 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C55ADC433C8; Thu, 23 Nov 2023 10:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700735881; bh=jNCvrYLWqFSMORBcd4VCK5iJmMYxeQ+pIicJZR1QdZU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FsF3kppGdYawW3i9ssq3ugB1MO1LBA6OQUjLWRF1guLmmJ8TOW3t9LMwbxsKBcJ+g zzIs1OOwIEY6MOFArp1AUt9Adt6vg4BoV4ercW4rwPUzVqgGJQCgz40Jjh4klDaQjo qANSsF44mdfTn2CJ7p9i8B958N8pVMxUtnaUyDsG0/sy2oQG+ab5ra8r5y0Bj399SR zeF1c5mqStT3VIkAAO/m3o97UyJ8KD/q4hpOcoaQRV5O7zeH0VpTkLx4Q+goDh/2RU C/kdUqnuNeDdxOqAvQjAivOxiBTqXwsND2WHyDoMdov7wn7UFHIDtk3bcaK9ObUAFB orjusgieYHYOA== Date: Thu, 23 Nov 2023 10:37:56 +0000 From: Lee Jones To: Peter Ujfalusi Cc: tony@atomide.com, robh@kernel.org, wens@csie.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mfd: twl6030-irq: Revert to use of_match_device() Message-ID: <20231123103756.GD1184245@google.com> References: <20231029114843.15553-1-peter.ujfalusi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231029114843.15553-1-peter.ujfalusi@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 > #include > #include > -#include > #include > #include > #include > +#include > > #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 > -- Lee Jones [李琼斯]