From nobody Sun Oct 5 16:20:37 2025 Received: from mx1.secunet.com (mx1.secunet.com [62.96.220.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A7731A23A6 for ; Thu, 31 Jul 2025 14:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.96.220.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753973106; cv=none; b=uwbgick2O282OFdfyJ4IvCCNuX1WJUtQx+xef7Xp3nSII83eUSSGk4/MSlrW+gGWnOPYyDdenjkZ/t26TcNuKI+5HBrhK6gBC4cVwObx9ctzsf++e5tddWpUt48TNnlbGsQ+qZoj6Pxu9wR6pgDQEwQOGrXPb+xHxW+d2F4q2IA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753973106; c=relaxed/simple; bh=VbZk0naDjC8ZePWABUYhTHspPTH9PL+GPWOLLLSK6iA=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=Ip59ts5DZS3CWmfWak2tw28zlfoIFqVgCA9t7WFQv5dyOAtHNpq/0UH1eGlqiXdyWI7EzKer5QNcKsij/p550GBXyNn0BRSvmTWA2ts5AjIJrOdnfWt6Q6e66r3lGeDDy+MLGuAtaXj7jVV+T/gVUha67MWd7VIvIjbMzfRwbC4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=secunet.com; spf=pass smtp.mailfrom=secunet.com; dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.b=0S7WDM/1; arc=none smtp.client-ip=62.96.220.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=secunet.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=secunet.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.b="0S7WDM/1" Received: from localhost (localhost [127.0.0.1]) by mx1.secunet.com (Postfix) with ESMTP id 95C55208B5; Thu, 31 Jul 2025 16:45:02 +0200 (CEST) X-Virus-Scanned: by secunet Received: from mx1.secunet.com ([127.0.0.1]) by localhost (mx1.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pxqNI8TkhTB9; Thu, 31 Jul 2025 16:45:02 +0200 (CEST) Received: from EXCH-03.secunet.de (unknown [10.32.0.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.secunet.com (Postfix) with ESMTPS id EA7C920892; Thu, 31 Jul 2025 16:45:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com EA7C920892 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com; s=202301; t=1753973102; bh=VbZk0naDjC8ZePWABUYhTHspPTH9PL+GPWOLLLSK6iA=; h=From:To:CC:Subject:Date:From; b=0S7WDM/1jAxNCYfcDspmt7shZjzkDIEog3adeVCoVx4Irn97uWDe72afUBvXvgacZ MMl1lvrV5uuQFMGe/SzSwGldGfaQXgBso/CvFZPXmrNv06IVrLlUl5xVYsRLQ++rSm Pteb4zln9cZnGkyQyRUh1FoPV0X0uxTFVBeAz6irxg2t+RuT8cPC4lI4PtYvkz8k1n /o3BC46qfvRuD6mxkzZJjbi0gunnFeuUPR+v5dm6GHpQwbBa97A4KmOS7m1H+f9NvY 5gQ4D3TgCOHtojC4ptFCdXKUTwqWBx/gzBzHDitLDkNzSRv8JHsY+bhOt/14fUp+xP E9RFlAroMhZjA== Received: from mbx-dresden-01.secunet.de (10.53.40.199) by EXCH-03.secunet.de (10.32.0.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1748.10; Thu, 31 Jul 2025 16:45:01 +0200 Received: from EXCH-04.secunet.de (10.32.0.184) by mbx-dresden-01.secunet.de (10.53.40.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 31 Jul 2025 16:45:00 +0200 Received: from EXCH-04.secunet.de ([fe80::f0d0:317:aa9d:ee57]) by EXCH-04.secunet.de ([fe80::f0d0:317:aa9d:ee57%4]) with mapi id 15.02.1748.010; Thu, 31 Jul 2025 16:45:00 +0200 From: "Heijligen, Thomas" To: "lee@kernel.org" , "andriy.shevchenko@linux.intel.com" , "linux-kernel@vger.kernel.org" CC: "Huber, Nico" , "michael.brunner@kontron.com" , "Schumann, Peter" Subject: [PATCH v2] mfd: kempld: Switch back to earlier ->init() behavior Thread-Topic: [PATCH v2] mfd: kempld: Switch back to earlier ->init() behavior Thread-Index: AQHcAimwhdkzkdq2i0C0BWDAKG+E9w== Date: Thu, 31 Jul 2025 14:45:00 +0000 Message-ID: <7d2c7e92253d851194a781720051536cca2722b8.camel@secunet.com> Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Commit 9e36775c22c7 ("mfd: kempld: Remove custom DMI matching code") removes the ability to load the driver if no matching system DMI data is found. Before this commit the driver could be loaded using alternative methods such as ACPI or `force_device_id` in the absence of a matching system DMI entry. Restore this ability while keeping the refactored `platform_device_info` table. Signed-off-by: Thomas Heijligen Reviewed-by: Andy Shevchenko --- drivers/mfd/kempld-core.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c index c5bfb6440a93..77980c7fc31f 100644 --- a/drivers/mfd/kempld-core.c +++ b/drivers/mfd/kempld-core.c @@ -779,22 +779,26 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table); static int __init kempld_init(void) { const struct dmi_system_id *id; - int ret =3D -ENODEV; =20 - for (id =3D dmi_first_match(kempld_dmi_table); id; id =3D dmi_first_match= (id + 1)) { - /* Check, if user asked for the exact device ID match */ - if (force_device_id[0] && !strstr(id->ident, force_device_id)) - continue; - - ret =3D kempld_create_platform_device(&kempld_platform_data_generic); - if (ret) - continue; - - break; + /* + * This custom DMI iteration allows the driver to be initialized in three= ways: + * - When a forced_device_id string matches any ident in the kempld_dmi_t= able, + * regardless of whether the DMI device is present in the system dmi ta= ble. + * - When a matching entry is present in the DMI system tabe. + * - Through alternative mechanisms like ACPI. + */ + if (force_device_id[0]) { + for (id =3D kempld_dmi_table; id->matches[0].slot !=3D DMI_NONE; id++) + if (strstr(id->ident, force_device_id)) + if (!kempld_create_platform_device(&kempld_platform_data_generic)) + break; + if (id->matches[0].slot =3D=3D DMI_NONE) + return -ENODEV; + } else { + for (id =3D dmi_first_match(kempld_dmi_table); id; id =3D dmi_first_matc= h(id+1)) + if (kempld_create_platform_device(&kempld_platform_data_generic)) + break; } - if (ret) - return ret; - return platform_driver_register(&kempld_driver); } =20 --=20 2.50.0