Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2183568rdh; Sun, 29 Oct 2023 04:49:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGej18lec4CBqRAeBEF2Xivg73GcIi828Z4Jifm4o3GiEPDvcj1p7r9s0FvXe9zV1fqY/Am X-Received: by 2002:a05:6a20:1b21:b0:172:eda5:36eb with SMTP id ch33-20020a056a201b2100b00172eda536ebmr7003784pzb.55.1698580160396; Sun, 29 Oct 2023 04:49:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698580160; cv=none; d=google.com; s=arc-20160816; b=A+CuO68MQqyILrWArEG6TwSDyO7ZhHe2Gr3qmTt5vTGdeKWtFytLzWgT8x3xTnQYvM Dc2cxJb1AZgrah5HJJFxOFzzLG+vDCu99OA99LfTcD7Q0yuX8JRxlpcFg1uR180UNfjb TJD1g1ngebtcgi7tPzPmolbpbXcAPMTikqUmgcqCv3GUM0M1b/UPCOZPvxCa/5b1SG+E V1+bSoW9mgp/P/Mu+au/F2XypScp5+vrNXOjyxCTmy0B9DQ2Uti/5mRhtz7i8kaauHbz DZd6GCl26RRTNradu1/dHZRgzFpq451yL2khAufuGXy1xcUpZTGIdvAujPmxNl8edwys aTVg== 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=ffdazMpImFy1FetHdByJmVjSy4MkPy3NHoIgY+vA/6Y=; fh=lyM3fRd5oHvigCXKQzjWd1gxAEns07NVcHHP24DeLj8=; b=pBA6zHEtciq9r9NOrEoGhDC5eu8+j5p6glVrepovvVG2vcE2/lPxeDllgg1EcfBjC+ 9ujgiUZpnTXwV9Uo8JQAFgIK6TsYSLD7L7iSXh01alCofzOE1WzgXT4SymtNkXvDshcI ca3stW5cTIa58C7JCZn4joEu7Ud8FNnWruVZizjhCJt1suulh1VoT+gqHqftYC/BT0sj 9aKozVAIpPyNYYc7klt3K4oVVkOyrdZX+/PMBcoyt8hyG9OVhhVBBt+YOweouxwbe3WH S/oAYgWXCz+BtfTRKsW19L0dERFgeJeyYtquVFGupMit4dPxnjT+IBTKj6V/O6NyCBng 9zLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dg39IE++; 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 Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id pi14-20020a17090b1e4e00b00274cd892b39si1072248pjb.132.2023.10.29.04.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 04:49:20 -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=dg39IE++; 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 ED323808EDFD; Sun, 29 Oct 2023 04:49:17 -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 S229972AbjJ2Lsq (ORCPT + 99 others); Sun, 29 Oct 2023 07:48:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbjJ2Lsp (ORCPT ); Sun, 29 Oct 2023 07:48:45 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAF1FBF; Sun, 29 Oct 2023 04:48:42 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-5079f9675c6so5411279e87.2; Sun, 29 Oct 2023 04:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698580121; x=1699184921; 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=ffdazMpImFy1FetHdByJmVjSy4MkPy3NHoIgY+vA/6Y=; b=dg39IE++4FuepBUfYEniHrmYgnTxrEV5K2PJJBh+pdU0jE4FcbYsV9TgwKH9oe7cDY jbgmhk/j3qu67kT03gnptnkWwWtJnU1sLmEWUBeLl8EMaq4Sj8dbV6fjtFBfJU4xsptw PLHB5tRnlwggLwyKMPWZpBBIEgZ7XLSKC/gwgMZzuJnQRzdO0SDBYu78s9Z22xnhJKOf MOBp2JJy3wbb0Wy5KM7O86rBBUD6K5wg5HUPH4dTiZrjsx5E+8yHO8tlMJIXx3N6Iios gp2J9BsteuM76mlhyT0dMdxwspjow8b21LwVnCF4mg8Y1f3qdbmmuUsAeyEglN17TD35 7wZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698580121; x=1699184921; 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=ffdazMpImFy1FetHdByJmVjSy4MkPy3NHoIgY+vA/6Y=; b=wd/93cxkjwzlBYcusGUz+3Q4ItkVebh5hHkCaupt9hdFV5A4T7NbinAUJxDyGmD6HZ HlgMjq6CtpDoeQ9ND04CXJy2jePlW+WDnlc28R3TyZfkIjEJCKFHO9RwCbm6ZMK23+FI 9USvEDRmzI4lO46iKtVnizuqlorvDck1K5R/F4xF1QxT9Ac9TR8V3vEyzxSDdTFLEsHi 5WieMCFTjKfeeTH5DSCf9IeAhH7Lxy2qyW7BRUe/ik/rvh5Dl0F61hezsTUqb0b4lLxq mtnQn1Uqey2SONvU5zg+pSYXYcjXZkzVJyjTZZWs364pW84hJoffZZFsO25FV5CyZ30U lviA== X-Gm-Message-State: AOJu0Yw8ApFVb2WBRaYHS6Ywozd7zjDeRhWMK/fMz/Ux8TNExOF+fznB qr+/HofxIX3o3a9apulw38o= X-Received: by 2002:a19:7004:0:b0:507:9b93:274b with SMTP id h4-20020a197004000000b005079b93274bmr5263657lfc.26.1698580120678; Sun, 29 Oct 2023 04:48:40 -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 ep7-20020a056512484700b00503f39e6bcesm1012464lfb.95.2023.10.29.04.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 04:48:40 -0700 (PDT) From: Peter Ujfalusi 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: twl4030-power: Revert to use of_match_device() Date: Sun, 29 Oct 2023 13:49:09 +0200 Message-ID: <20231029114909.15652-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: 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:49:18 -0700 (PDT) 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/twl4030-power.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 1595e9c76132..e35b0f788c50 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -27,8 +27,8 @@ #include #include #include -#include #include +#include #include @@ -883,6 +883,7 @@ static int twl4030_power_probe(struct platform_device *pdev) { const struct twl4030_power_data *pdata = dev_get_platdata(&pdev->dev); struct device_node *node = pdev->dev.of_node; + const struct of_device_id *match; int err = 0; int err2 = 0; u8 val; @@ -903,8 +904,10 @@ static int twl4030_power_probe(struct platform_device *pdev) return err; } - if (node) - pdata = device_get_match_data(&pdev->dev); + match = of_match_device(of_match_ptr(twl4030_power_of_match), + &pdev->dev); + if (match && match->data) + pdata = match->data; if (pdata) { err = twl4030_power_configure_scripts(pdata); -- 2.42.0