Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3355233rwa; Tue, 23 Aug 2022 03:27:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR533sgMZ+Wmw6yGzIssQwITuxItL/GV8JR144Zhc853Fk2FoVzraGu4/pTc8KuzQu5hKD+D X-Received: by 2002:a05:6402:14cd:b0:446:52ed:f131 with SMTP id f13-20020a05640214cd00b0044652edf131mr3089568edx.341.1661250453975; Tue, 23 Aug 2022 03:27:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661250453; cv=none; d=google.com; s=arc-20160816; b=Ull+0Fb9kV41Z1JpCuOgk3tInuPJIH3QSq7KqWtlyHUXGTMkXN+Phut4Yp/8Wf8lwq 6l7f6qg5+DYFXl3vGx4IOaHTrIODCQp87FVHMpYh+y7HvfUeYHRwK170TLraSBg8VO0c YXhs5TIZ5d1wAOlxsBkgRVSp1OdMAjyZ9fO3RrL0bluk4a4zQuXime08JsV9ODX7hW6m 6CUVoiL6aDh/kBwD5v56pLuoNVYASpg5PoP9/g9WYN3sOMh7ppN7T+uZveCcY4qLe7i2 /r3qGCKbUHil0JhMoxfBx6ydhg1C/16s0f5DZd/OU83C3FnmycKlbZZKgq7fTctmZfs+ 3gfQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B/aJjPO6SIHrf/ULLoF5w7k9pu0Nc3UbN5a/8b/jZXI=; b=fkuSV6j2R3MPxDLbWBoaSO6uc+QV5H7ndvGLpRZECwhL3oJnN1/+pvUMPpsEhGXrSH hNXOZhmwuCnST2H8cPUJeRT5iuYQUJM/12ayN9inZU/7o/1CRBNIeIoPBKtR9APfHic0 9+iUGL115qOcZNVySVdmxa2jy+shUjOXZnntrqoLrBW0WLud68tEiB6o0e8pBwSFjaFq 0YyTNOVQvjiZZme9mrTXIDMDfvfXtLMmrO3xZb6Qeg5U3EEsmLrXMcP649KDOgf/20i7 xP6WPVkjtoCRiCtwYsMUpKK70E0LYFSeIchaMcJWOjPo80fy1adzAkPAfUPT0DZJU62y Hbng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RsAId4ko; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t28-20020a508d5c000000b0043c7ceb229asi1639251edt.207.2022.08.23.03.27.03; Tue, 23 Aug 2022 03:27:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RsAId4ko; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353208AbiHWKXt (ORCPT + 99 others); Tue, 23 Aug 2022 06:23:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353520AbiHWKLg (ORCPT ); Tue, 23 Aug 2022 06:11:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7298B719A4; Tue, 23 Aug 2022 01:57:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2ADB8B81C3A; Tue, 23 Aug 2022 08:57:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81E6FC433D6; Tue, 23 Aug 2022 08:56:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245019; bh=YJQdeheKy3hP9l/pnqJdEujrSGFaTCm5AvS8wFuLOtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RsAId4ko1dVEtFqPuT9Q341ELRHu1Deub/QPvXcTUCpfTbHZV+rnaMZHdzGLAt/bf VDbvD4W4lG6MbzDWEFvSdoGV2bBC9Dyc4PDfNAxC5qN7c3UYS7WA9Ddkheqllq86po 35ttCMeB6YhdYYzL0QfKuxAzNf5WV8+W4AtZZiu0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Henning Schild , Andy Shevchenko , Hans de Goede , Mika Westerberg , Linus Walleij , Lee Jones , Sasha Levin Subject: [PATCH 5.15 189/244] pinctrl: intel: Check against matching data instead of ACPI companion Date: Tue, 23 Aug 2022 10:25:48 +0200 Message-Id: <20220823080105.692228947@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko [ Upstream commit c551bd81d198bf1dcd4398d5454acdc0309dbe77 ] In some cases we may get a platform device that has ACPI companion which is different to the pin control described in the ACPI tables. This is primarily happens when device is instantiated by board file. In order to allow this device being enumerated, refactor intel_pinctrl_get_soc_data() to check the matching data instead of ACPI companion. Reported-by: Henning Schild Signed-off-by: Andy Shevchenko Tested-by: Henning Schild Acked-by: Hans de Goede Acked-by: Mika Westerberg Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/pinctrl/intel/pinctrl-intel.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index 826d494f3cc6..48f55991ae8c 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -1626,16 +1626,14 @@ EXPORT_SYMBOL_GPL(intel_pinctrl_probe_by_uid); const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_device *pdev) { + const struct intel_pinctrl_soc_data * const *table; const struct intel_pinctrl_soc_data *data = NULL; - const struct intel_pinctrl_soc_data **table; - struct acpi_device *adev; - unsigned int i; - adev = ACPI_COMPANION(&pdev->dev); - if (adev) { - const void *match = device_get_match_data(&pdev->dev); + table = device_get_match_data(&pdev->dev); + if (table) { + struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); + unsigned int i; - table = (const struct intel_pinctrl_soc_data **)match; for (i = 0; table[i]; i++) { if (!strcmp(adev->pnp.unique_id, table[i]->uid)) { data = table[i]; @@ -1649,7 +1647,7 @@ const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_ if (!id) return ERR_PTR(-ENODEV); - table = (const struct intel_pinctrl_soc_data **)id->driver_data; + table = (const struct intel_pinctrl_soc_data * const *)id->driver_data; data = table[pdev->id]; } -- 2.35.1