From patchwork Sun Oct 29 11:49:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?P=C3=A9ter_Ujfalusi?= X-Patchwork-Id: 13439763 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 ADA00C4332F for ; Sun, 29 Oct 2023 11:48:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229482AbjJ2Lsp (ORCPT ); Sun, 29 Oct 2023 07:48:45 -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-Google-Smtp-Source: AGHT+IGGEFN9dF9/qUdc8I54PBYmXWj2i/68f+/tnbsYXwGqFU/BfZzXtg+hd3Gsw9smrCdydi9yPA== 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 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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);