From nobody Sun Feb 8 04:11:12 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 B29AD149393 for ; Fri, 23 Feb 2024 19:51:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708717881; cv=none; b=axnxPaQPsceBfhJAccecNWUg0aOgc3T5l7PwkzrLUDnza3zifMER16DEKHP7tSFY9mjThFXjh0cqpISvVAe/zEH86cx7PPvv0U+Hhtop7YZXL6abXlrncuOa95/oefCxc7p73r26OrmXQhlxfzMRDm96UmmRy2Bpc65jAtL7X5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708717881; c=relaxed/simple; bh=Wj2D0oBH1J9oTB67/0tbEOo9q7DzAHlzlDkwpbhKu14=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GZzirf40fbOu8kM4u0oK52RLZQxbDa4Tjpe2V2kI/s9FVwYPPkHqS0ux6/1xVxexS7y1DJZdB0j5XzXXRCu4TE+wLef9JBsW1kmAWyMtjaawGcmd0jF2aQgcrHgs6ybpuEvq5TxPFjSdb4qlL/ImZt2r2j324smwdU+X1ulvm8o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=h0wh6rG4; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="h0wh6rG4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708717880; x=1740253880; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Wj2D0oBH1J9oTB67/0tbEOo9q7DzAHlzlDkwpbhKu14=; b=h0wh6rG4xI7UdJN6Yq86nPJN+fhEvIoJ7IpAY531V97qvdwdYmccJER5 +2h313nLl3jR1DN8E85cYS9fdeRvOaVWCliArOQObZicEF5J9jL7KQyZl 3mbouiNhjMAM7yPDl/nRND2BBtmHHrUAwAhxssnJuuUMnKdjyiJd9ByeA lLhM1GXjlPji3n33ENctX7RJJ+nx8Uw+ke84CyUVMSuYuuwLmx/Gyfe3i rC7oSHX6mJv3S9d7swQlb1zlS0qij7nzKvA2reJ5LmTZzUYj2AeYOpQPs PYwCjBnDcL3h0m+UNsa8YvDDTn4b4MyMtKv3PIq61QAeJMZIThUGjUDKD A==; X-IronPort-AV: E=McAfee;i="6600,9927,10993"; a="6837326" X-IronPort-AV: E=Sophos;i="6.06,180,1705392000"; d="scan'208";a="6837326" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2024 11:51:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10993"; a="937025652" X-IronPort-AV: E=Sophos;i="6.06,180,1705392000"; d="scan'208";a="937025652" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 23 Feb 2024 11:51:15 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 96B134A5; Fri, 23 Feb 2024 21:51:14 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Lee Jones Subject: [PATCH v1 1/6] mfd: kempld: Replace ACPI code with agnostic one Date: Fri, 23 Feb 2024 21:49:50 +0200 Message-ID: <20240223195113.880121-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240223195113.880121-1-andriy.shevchenko@linux.intel.com> References: <20240223195113.880121-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There is no need to include and use entire ACPI stack in the driver. Replace respective pieces by agnostic code. No functional change indented. Signed-off-by: Andy Shevchenko --- drivers/mfd/kempld-core.c | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c index 5557f023a173..99c8656e723c 100644 --- a/drivers/mfd/kempld-core.c +++ b/drivers/mfd/kempld-core.c @@ -9,11 +9,12 @@ #include #include #include +#include #include +#include #include #include #include -#include =20 #define MAX_ID_LEN 4 static char force_device_id[MAX_ID_LEN + 1] =3D ""; @@ -425,26 +426,6 @@ static int kempld_detect_device(struct kempld_device_d= ata *pld) return ret; } =20 -#ifdef CONFIG_ACPI -static int kempld_get_acpi_data(struct platform_device *pdev) -{ - struct device *dev =3D &pdev->dev; - const struct kempld_platform_data *pdata; - int ret; - - pdata =3D acpi_device_get_match_data(dev); - ret =3D platform_device_add_data(pdev, pdata, - sizeof(struct kempld_platform_data)); - - return ret; -} -#else -static int kempld_get_acpi_data(struct platform_device *pdev) -{ - return -ENODEV; -} -#endif /* CONFIG_ACPI */ - static int kempld_probe(struct platform_device *pdev) { const struct kempld_platform_data *pdata; @@ -458,10 +439,16 @@ static int kempld_probe(struct platform_device *pdev) * No kempld_pdev device has been registered in kempld_init, * so we seem to be probing an ACPI platform device. */ - ret =3D kempld_get_acpi_data(pdev); + pdata =3D device_get_match_data(dev); + if (!pdata) + return -ENODEV; + + ret =3D platform_device_add_data(pdev, pdata, sizeof(*pdata)); if (ret) return ret; - } else if (kempld_pdev !=3D pdev) { + } else if (kempld_pdev =3D=3D pdev) { + pdata =3D dev_get_platdata(dev); + } else { /* * The platform device we are probing is not the one we * registered in kempld_init using the DMI table, so this one @@ -472,7 +459,6 @@ static int kempld_probe(struct platform_device *pdev) dev_notice(dev, "platform device exists - not using ACPI\n"); return -ENODEV; } - pdata =3D dev_get_platdata(dev); =20 pld =3D devm_kzalloc(dev, sizeof(*pld), GFP_KERNEL); if (!pld) @@ -509,19 +495,17 @@ static void kempld_remove(struct platform_device *pde= v) pdata->release_hardware_mutex(pld); } =20 -#ifdef CONFIG_ACPI static const struct acpi_device_id kempld_acpi_table[] =3D { { "KEM0000", (kernel_ulong_t)&kempld_platform_data_generic }, { "KEM0001", (kernel_ulong_t)&kempld_platform_data_generic }, {} }; MODULE_DEVICE_TABLE(acpi, kempld_acpi_table); -#endif =20 static struct platform_driver kempld_driver =3D { .driver =3D { .name =3D "kempld", - .acpi_match_table =3D ACPI_PTR(kempld_acpi_table), + .acpi_match_table =3D kempld_acpi_table, }, .probe =3D kempld_probe, .remove_new =3D kempld_remove, --=20 2.43.0.rc1.1.gbec44491f096