From nobody Thu Dec 18 13:00:01 2025 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 E7A20C32774 for ; Tue, 23 Aug 2022 09:14:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243828AbiHWJOj (ORCPT ); Tue, 23 Aug 2022 05:14:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243728AbiHWJLs (ORCPT ); Tue, 23 Aug 2022 05:11:48 -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 9A4F36D57B; Tue, 23 Aug 2022 01:31:38 -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 02427B81C35; Tue, 23 Aug 2022 08:31:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 677D2C433D6; Tue, 23 Aug 2022 08:31:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243494; bh=xXQAFQ/1p0AoaeHh21LVzZFWzJxzwfUL99cZqTHOlzM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BRPyqgJeAHdsgxBxKhk9TnteKODs6XGsJhH0c7uKlznJuiffLJNYKPUa5XakhkYv+ ZeYYrKxUrN8v2npefdkmCSEVXm+dc+F+Zd5d2IdyyUbSL2ePGvafwL+O2hsT6KmrKS QouRhycdAPTk7/iqfuhKmrrfRzCUY+EQ3rlS6VrE= 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.19 294/365] pinctrl: intel: Check against matching data instead of ACPI companion Date: Tue, 23 Aug 2022 10:03:15 +0200 Message-Id: <20220823080130.502152431@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 ffc045f7bf00..fd093e36c3a8 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -1641,16 +1641,14 @@ EXPORT_SYMBOL_GPL(intel_pinctrl_probe_by_uid); =20 const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct pla= tform_device *pdev) { + const struct intel_pinctrl_soc_data * const *table; const struct intel_pinctrl_soc_data *data =3D NULL; - const struct intel_pinctrl_soc_data **table; - struct acpi_device *adev; - unsigned int i; =20 - adev =3D ACPI_COMPANION(&pdev->dev); - if (adev) { - const void *match =3D device_get_match_data(&pdev->dev); + table =3D device_get_match_data(&pdev->dev); + if (table) { + struct acpi_device *adev =3D ACPI_COMPANION(&pdev->dev); + unsigned int i; =20 - table =3D (const struct intel_pinctrl_soc_data **)match; for (i =3D 0; table[i]; i++) { if (!strcmp(adev->pnp.unique_id, table[i]->uid)) { data =3D table[i]; @@ -1664,7 +1662,7 @@ const struct intel_pinctrl_soc_data *intel_pinctrl_ge= t_soc_data(struct platform_ if (!id) return ERR_PTR(-ENODEV); =20 - table =3D (const struct intel_pinctrl_soc_data **)id->driver_data; + table =3D (const struct intel_pinctrl_soc_data * const *)id->driver_data; data =3D table[pdev->id]; } =20 --=20 2.35.1