From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (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 952FD1C6F71; Wed, 23 Oct 2024 15:22:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696922; cv=none; b=QyrEkBb/KWqS5maLl7yhiQfG3EbpBesecLo6uZapiSQy66WPnIrDZYhbmSrd/EzwD5jxSJCg9707FHZeF083R3cBGhnsvqRCoA1JIo/lBSkCiGvRf/7+2ReEs9E0B1a63S7Z/P3zbRMEJZEbf4c9/zHlwQ83yMsQBmyQGhcSe+o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696922; c=relaxed/simple; bh=EvqHvmqySQB6ykPyYZ17efivk2BOCoil+F/v0X6V9zA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sxTruDoIrcNeKkI9UHz6SZ4lMnB0/I8VMAH8Fkvwat4jVUIT5mK4mQ+71HZgZWaP9Wmo9sVTFMxH5L2ca/uE0gc2PfPtriJJZyjPnmcaXufeMkL/gm8Ap5aybHHZSKjkf9IIrzaf6BWeULJcE98h7dFP87JShiyyqPdJnFvURwA= 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=chv30kM6; arc=none smtp.client-ip=198.175.65.18 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="chv30kM6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696920; x=1761232920; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EvqHvmqySQB6ykPyYZ17efivk2BOCoil+F/v0X6V9zA=; b=chv30kM68y3Ln09uCKZGyw+7TdPtnISqliZmyIJ8sbk1CGfS63K+VbAT YhbeuS5ehcw74sSHqsfwZkIrIVeaoCfk7s/OYFFGRbKCH92O4uRFsvdjg jkDhloRayZcVAniqRCJSVRkBt0rhB8nJDsbmwsbU1EdOZ0n11463uGwQT HqTNws7l9YkEvriRrTO924W4ukK+GXovyearc39/z5cyzJUkF+IVwM5lh XqWkDtMmS55gRIvN8RyySvJ1DCneiyi13uAl5JraLrCViW7fg9J8k0gCD /iQIkYeaONGn9bCZ5iqKH/yllACKYcI70Hu86fG1e2Zwa4fsGTYsBa1oO Q==; X-CSE-ConnectionGUID: b64rVXG7TKWT/VLunXQlqg== X-CSE-MsgGUID: yqT+kIJQQPS79DF446/4Iw== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="29449170" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="29449170" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:58 -0700 X-CSE-ConnectionGUID: 5kS7MwdcQjCbvlL871Gt/w== X-CSE-MsgGUID: DhSO68g/Tvy1XDUmB4QtvA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="80179590" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa010.jf.intel.com with ESMTP; 23 Oct 2024 08:21:50 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9BF3C17E; Wed, 23 Oct 2024 18:21:48 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol Subject: [PATCH v1 01/13] iio: magnetometer: bmc150: Drop dead code from the driver Date: Wed, 23 Oct 2024 18:17:24 +0300 Message-ID: <20241023152145.3564943-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" Since there is no ACPI IDs for this driver to be served for, drop dead ACPI bits from it completely. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/magnetometer/bmc150_magn.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetome= ter/bmc150_magn.c index 06d5a1ef1fbd..7de18c4a0ccb 100644 --- a/drivers/iio/magnetometer/bmc150_magn.c +++ b/drivers/iio/magnetometer/bmc150_magn.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -855,17 +854,6 @@ static const struct iio_buffer_setup_ops bmc150_magn_b= uffer_setup_ops =3D { .postdisable =3D bmc150_magn_buffer_postdisable, }; =20 -static const char *bmc150_magn_match_acpi_device(struct device *dev) -{ - const struct acpi_device_id *id; - - id =3D acpi_match_device(dev->driver->acpi_match_table, dev); - if (!id) - return NULL; - - return dev_name(dev); -} - int bmc150_magn_probe(struct device *dev, struct regmap *regmap, int irq, const char *name) { @@ -894,9 +882,6 @@ int bmc150_magn_probe(struct device *dev, struct regmap= *regmap, if (ret) return ret; =20 - if (!name && ACPI_HANDLE(dev)) - name =3D bmc150_magn_match_acpi_device(dev); - mutex_init(&data->mutex); =20 ret =3D bmc150_magn_init(data); --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (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 2A3501C9DF0; Wed, 23 Oct 2024 15:22:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696923; cv=none; b=aSYFzsu0KDzcMevGOwomek+E9py56yvXas8Uz26iFfjZ7cVzLwTYmJseZvJgRyUIenqmsr751jgb98PejTWUy/yHA9ROQhgW9vvdWCYDX0+Sl0eEe6gV/dvgQwSCFdlr2zaTSgxEtbwJFwOKjtIGLTYRLttzH6G2SW5nnaie69Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696923; c=relaxed/simple; bh=g7gsiFyTFv7Za8SX5zX0SA6kCD+jSDqqfZf5G6BIMHs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XjlOTgwUpJ3+2LR6+y7rjdz+wrKhHjx2ra/mZ0qENGbsm/j9k35yVNuQOmBY9cv/6EW2eMA4RiBEWVz2qycPnAqg6LkiRBdb05wZa772VUZUO7E8Sp2+ddzBYhaUsWd6YU/yNY/sf80D24OhIYQVatUMk5CuFw/WIneAl/Ke4NI= 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=BS++zzW8; arc=none smtp.client-ip=198.175.65.18 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="BS++zzW8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696922; x=1761232922; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=g7gsiFyTFv7Za8SX5zX0SA6kCD+jSDqqfZf5G6BIMHs=; b=BS++zzW8wXZrTk4liatzV9z+cPhzeAMEd58tFKW6oCQ4qbH5BCW6KbJr 1uUnczlT/XTtn8j8e2sQJxO3UsM3gC5dkoUr8UPbTcMvSH0FSyugqulKb 4q1amfsu9jHsgbgn0tGVBJk2NFYSBvUcvpza7UH2fae6Am6nt3wapQO5p 7THgS54x0BiGhPIgnBLfglAicYgZauehSCoJlUxh4IqzwG1aqMOY/SIjE 6kmwlT1pT29xfiPmgTJuSZB21r03SsrlnLW/7t19VlKAIlRiWES5IsxJw ffc1cPBYTYZntlLkwOa34RrTsRHb2XfZPAfhx9u61AstLhy7/Cfv7r/fW Q==; X-CSE-ConnectionGUID: ISX+A/DBQfO2mFiKfZwPqg== X-CSE-MsgGUID: vUGb0bIuQFmRPuNOAjX/kg== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="29449182" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="29449182" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:58 -0700 X-CSE-ConnectionGUID: heKXpq+4SrKLCZ8arLsIew== X-CSE-MsgGUID: u0EPhikiT26+dIhLeRmBZQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="80179592" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa010.jf.intel.com with ESMTP; 23 Oct 2024 08:21:50 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id A64BB331; Wed, 23 Oct 2024 18:21:48 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol Subject: [PATCH v1 02/13] iio: adc: pac1934: Replace strange way of checking type of enumeration Date: Wed, 23 Oct 2024 18:17:25 +0300 Message-ID: <20241023152145.3564943-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" When device is enumerated via ACPI the respective device node is of ACPI device type. Use that to check for ACPI enumeration, rather than calling for full match which is O(n) vs. O(1) for the regular check. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/adc/pac1934.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/pac1934.c b/drivers/iio/adc/pac1934.c index 7ef249d83286..20802b7f49ea 100644 --- a/drivers/iio/adc/pac1934.c +++ b/drivers/iio/adc/pac1934.c @@ -1507,7 +1507,7 @@ static int pac1934_probe(struct i2c_client *client) indio_dev->name =3D pac1934_chip_config[ret].name; } =20 - if (acpi_match_device(dev->driver->acpi_match_table, dev)) + if (is_acpi_device_node(dev_fwnode(dev))) ret =3D pac1934_acpi_parse_channel_config(client, info); else /* --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 5924E1C3318; Wed, 23 Oct 2024 15:22:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696948; cv=none; b=UWnCZAF007kXnjowGVU0OumQF6hMVp1z5+0mCsJXTsMlakTDkI4sIor8U3F30NL2vm0bvDF43C3NMb7sc+8Uoe3b+qWb80R+UimJa6FXJhulE2lvxd0t52tUTGV97jPNM+PPpdF6fBs/fAq89+lGK4DZisxW09UGtRJTeGF1f84= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696948; c=relaxed/simple; bh=sQn3XKO4IzTmW1nY5JMl4V8hhJQCw0hKg+BK0qJqweQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X5HOFDpTWFGuOoX3MjUnGtJBuVmAWGi0xAOp973QUJn0HmyA9MljxqdSaugA8R1GGvtzUPjgJlNeAYygqnJa1JXCxuIv3fspH9OkZa0HfE4a2g8erKq119y9VHl+cL43Sx9BwZFc8NJdFV/iNndXG+80U3+Aej2WRu117QNKq+k= 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=jiMklJ27; arc=none smtp.client-ip=198.175.65.11 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="jiMklJ27" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696948; x=1761232948; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sQn3XKO4IzTmW1nY5JMl4V8hhJQCw0hKg+BK0qJqweQ=; b=jiMklJ27AOO9GsPVSMq61out7JFvjT4f/fJqspmUtGsC0XyMHJuxlG5C 8b8c2yFJ2MhdGd/1t1XDJKohsLKzu6XU6144yKDZzpo+HVP5UToJ9KOt7 kTndkXbcFc0/eoYgR/RImR8H6e59A3SDJ7Yr+TkgKKMR8gJrIptJsoY3/ SfrGHZgEgUG6rayYG/qbIRXtJcS1z3r5dsxvzId1zpi2oflxLB67zmPrN s1kZLh6GeiRMiqgHk6u2blDl7ypvnrkpWuxGMtfanWElR4ezfCXYUebb5 SjH/lGVBDyAfexmtckt1NHrH9GpJv6+Z0Jd2TC573vtlBwqY/289xTNkF Q==; X-CSE-ConnectionGUID: cJ8J1pr2Qm2mZ9SX7wva2g== X-CSE-MsgGUID: nleDXZ5CTZ61Y6FRPwk3cQ== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="39841467" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="39841467" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:53 -0700 X-CSE-ConnectionGUID: O+QSFN+WSauhqmJvWo+hhA== X-CSE-MsgGUID: PfGRHoYzS/yDT7Qml/uRPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="80430762" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 23 Oct 2024 08:21:50 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id B05162E9; Wed, 23 Oct 2024 18:21:48 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol Subject: [PATCH v1 03/13] iio: imu: inv_mpu6050: Replace strange way of checking type of enumeration Date: Wed, 23 Oct 2024 18:17:26 +0300 Message-ID: <20241023152145.3564943-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" When device is enumerated via ACPI the respective device node is of ACPI device type. Use that to check for ACPI enumeration, rather than calling for full match which is O(n) vs. O(1) for the regular check. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c b/drivers/iio/imu/i= nv_mpu6050/inv_mpu_acpi.c index b15d8c94cc11..373e59f6d91a 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c @@ -104,14 +104,11 @@ static int inv_mpu_process_acpi_config(struct i2c_cli= ent *client, unsigned short *secondary_addr) { struct acpi_device *adev =3D ACPI_COMPANION(&client->dev); - const struct acpi_device_id *id; u32 i2c_addr =3D 0; LIST_HEAD(resources); int ret; =20 - id =3D acpi_match_device(client->dev.driver->acpi_match_table, - &client->dev); - if (!id) + if (!is_acpi_device_node(dev_fwnode(&client->dev))) return -ENODEV; =20 ret =3D acpi_dev_get_resources(adev, &resources, --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 23B721C9B80; Wed, 23 Oct 2024 15:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696954; cv=none; b=FlF4/YnyCtNc1jV5ZLRsE1ohljhl9CID70Zumyd+2rKTs786XDV/XG9Yk6x79vB+ykojs34VcjCIbQshiAyn2A8vFWM+NsoG7GKsLjYPcWvpPUsAOmebxctR3ofvGwLqv+V/x8w9y8/QV5jt/NbcvqdA59c/mtoQ+Ax85f6hVyc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696954; c=relaxed/simple; bh=RF5+mrIcKaB42Sfsuzez/O8IYdODrDQIqAH82hA23Qs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WkwQp0zIMJYDDGhU6Jbqqe15f49hjSBILcAGEIdFI7GJw6aRDTisXRxcGeLrZFOJkPGhlK5fg5hCzd4krIeTqsmp52CPoqKr+G+LvtjVScK/krgjNmi4e9Mfs8S7fIGspF0Qu9hry5OUBcpOJH9ctaURT0Qb0PKfxqd5LsBTGoI= 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=fVjDfeEy; arc=none smtp.client-ip=198.175.65.11 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="fVjDfeEy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696953; x=1761232953; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RF5+mrIcKaB42Sfsuzez/O8IYdODrDQIqAH82hA23Qs=; b=fVjDfeEyam0rrkeevUa8GjTngFQtoFfw1jxNYSUpKiZFTxcxJYtbIGIM jLQUnvpzCbb07Bb83XTuS6uGWKLKvfuFiZcjTFyEEYcG+3QhGYwfc+UAy WKbU05n39OivwFtH488Pg0kpUtqHAhKRmtZq2gmS7Q4xJRpYaHe7Cm/9T I6KYZjp9DUrnK2mPlD7t+ZogW4KSRXRtJ64Z3Qd94xtMOoH1YqSXGVIEr 3NkBVh6GADJcNnHQfCFcyUCRYFnlH0GfXxvxuMwGeEcT1ZqjHlDM6Xe1X nk8D8pDcuuCYkrc19Tj1fAzXdwIRTfBfmG9lH8EPIfH25/daT3I2BOsN9 A==; X-CSE-ConnectionGUID: /jA+W34HSY6hHwbm7mU8Ow== X-CSE-MsgGUID: P7AXTL98SsGHdJklDkWtIw== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="39841476" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="39841476" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:53 -0700 X-CSE-ConnectionGUID: 3RcXvmPjRTCFSFJOLbrH5g== X-CSE-MsgGUID: r61uQNu3QFClhbDcVRZpBQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="80430764" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 23 Oct 2024 08:21:50 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C129741D; Wed, 23 Oct 2024 18:21:48 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol , Andy Shevchenko Subject: [PATCH v1 04/13] iio: acpi: Improve iio_read_acpi_mount_matrix() Date: Wed, 23 Oct 2024 18:17:27 +0300 Message-ID: <20241023152145.3564943-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" From: Andy Shevchenko By using ACPI_HANDLE() the handler argument can be retrieved directly. Replace ACPI_COMPANION() + dereference with ACPI_HANDLE(). Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/industrialio-acpi.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/iio/industrialio-acpi.c b/drivers/iio/industrialio-acp= i.c index 981b75d40780..1e46908f9534 100644 --- a/drivers/iio/industrialio-acpi.c +++ b/drivers/iio/industrialio-acpi.c @@ -28,17 +28,21 @@ bool iio_read_acpi_mount_matrix(struct device *dev, char *acpi_method) { struct acpi_buffer buffer =3D { ACPI_ALLOCATE_BUFFER, NULL }; - struct acpi_device *adev =3D ACPI_COMPANION(dev); char *str; union acpi_object *obj, *elements; + acpi_handle handle; acpi_status status; int i, j, val[3]; bool ret =3D false; =20 - if (!adev || !acpi_has_method(adev->handle, acpi_method)) + handle =3D ACPI_HANDLE(dev); + if (!handle) return false; =20 - status =3D acpi_evaluate_object(adev->handle, acpi_method, NULL, &buffer); + if (!acpi_has_method(handle, acpi_method)) + return false; + + status =3D acpi_evaluate_object(handle, acpi_method, NULL, &buffer); if (ACPI_FAILURE(status)) { dev_err(dev, "Failed to get ACPI mount matrix: %d\n", status); return false; --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 45FA51BDA8F; Wed, 23 Oct 2024 15:21:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696919; cv=none; b=sGUJdruEVmnCGWkri3D6ThZbZaAQkiYnEOQRInAEXtFsIe/NNDhQA/ypfzWjZLnDile6DWol7L8TFMeFXyWIVvbQO15mWwVkh2eXc7WNuMVtYhJrTEZMYqWIkmP3Q6Hv4XtjK+bKcOAQmPWj7m9L7AmdNIc64DmjW9681uzUd0M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696919; c=relaxed/simple; bh=qGFrLAzLBa1UVY//MxJ0MY/Oz1e9GIAtr9LCUj3kOWM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jk0ABs3btjBmJgw7HJneWqxKeoOa9pJH9rg37FjHeMHTNxGkSc5LmoGrUJAQEgC4j9hB4mEcDhYQfIl/bWR9BC1e9jbb6R5Vq/HyPo1/PFz8t6gjXoj4p6Bu8aU/fDtzoWxDRtwDMA/HU4WB90g+M8g6R3ilxkJsgPr6cOf4/dk= 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=TkF3PMrt; arc=none smtp.client-ip=198.175.65.10 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="TkF3PMrt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696919; x=1761232919; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qGFrLAzLBa1UVY//MxJ0MY/Oz1e9GIAtr9LCUj3kOWM=; b=TkF3PMrtdJOKkaxVegnte0xL4BLjc7hIeSV0LJV2500AvcJvu/6juogS 9ViIYDzvjNZLH6Cs1StjwSQentPoMQeJWynhKvgTIg8sl7PbeDmCC33u3 eFgl10VdtLFcYJL9Peo3trpgjdoUiU0wsQqsQkvVMBcbTMWUStB8LA2bP KQ8cyzFd/82dRjwTv5iMPlH+p1Aw2TZxLzIhiz1G0BThKgQ4PYApam05y yuxO+SKse/YozOJeqct6J3bw21ze4VxEPDr9uwVtfguPyUB1m0U9ybZIf +gbAhJDe3Bhwmpe4LYyM61SndKIORr219l4h9Jilq2C4CM4g4ecVkUr2V Q==; X-CSE-ConnectionGUID: YcPTmGYpSTmOQwvaV5Jm7A== X-CSE-MsgGUID: V/XDJHBNTmelSSkLgRr4hA== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="46757911" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="46757911" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:56 -0700 X-CSE-ConnectionGUID: 6aBiLJeLQV24QnEbciROhw== X-CSE-MsgGUID: 6JOqbKK8R0mU/Pds2BVubQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="79823542" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 23 Oct 2024 08:21:53 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id D0E524D5; Wed, 23 Oct 2024 18:21:48 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol Subject: [PATCH v1 05/13] iio: acpi: Add iio_get_acpi_device_name_and_data() helper function Date: Wed, 23 Oct 2024 18:17:28 +0300 Message-ID: <20241023152145.3564943-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" A few drivers duplicate the code to retrieve ACPI device instance name. Some of them want an associated driver data as well. In order of deduplication introduce the common helper functions. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/industrialio-acpi.c | 35 ++++++++++++++++++++++++++++++++- include/linux/iio/iio.h | 10 ++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/iio/industrialio-acpi.c b/drivers/iio/industrialio-acp= i.c index 1e46908f9534..0003f6c67580 100644 --- a/drivers/iio/industrialio-acpi.c +++ b/drivers/iio/industrialio-acpi.c @@ -2,7 +2,8 @@ /* IIO ACPI helper functions */ =20 #include -#include +#include +#include #include #include =20 @@ -87,3 +88,35 @@ bool iio_read_acpi_mount_matrix(struct device *dev, return ret; } EXPORT_SYMBOL_GPL(iio_read_acpi_mount_matrix); + +/** + * iio_get_acpi_device_name_and_data() - Return ACPI device instance name = and driver data + * @dev: Device structure + * @data: Optional pointer to return driver data + * + * When device was enumerated by ACPI ID matching, the user might + * want to set description for the physical chip. In such cases + * the ACPI device instance name might be used. This call may be + * performed to retrieve this information. + * + * Returns: ACPI device instance name or %NULL. + */ +const char *iio_get_acpi_device_name_and_data(struct device *dev, const vo= id **data) +{ + const struct acpi_device_id *id; + acpi_handle handle; + + handle =3D ACPI_HANDLE(dev); + if (!handle) + return NULL; + + id =3D acpi_match_device(dev->driver->acpi_match_table, dev); + if (!id) + return NULL; + + if (data) + *data =3D (const void *)id->driver_data; + + return dev_name(dev); +} +EXPORT_SYMBOL_GPL(iio_get_acpi_device_name_and_data); diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 3a9b57187a95..445d6666a291 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -831,6 +831,7 @@ int iio_device_resume_triggering(struct iio_dev *indio_= dev); bool iio_read_acpi_mount_matrix(struct device *dev, struct iio_mount_matrix *orientation, char *acpi_method); +const char *iio_get_acpi_device_name_and_data(struct device *dev, const vo= id **data); #else static inline bool iio_read_acpi_mount_matrix(struct device *dev, struct iio_mount_matrix *orientation, @@ -838,7 +839,16 @@ static inline bool iio_read_acpi_mount_matrix(struct d= evice *dev, { return false; } +static inline const char * +iio_get_acpi_device_name_and_data(struct device *dev, const void **data) +{ + return NULL; +} #endif +static inline const char *iio_get_acpi_device_name(struct device *dev) +{ + return iio_get_acpi_device_name_and_data(dev, NULL); +} =20 /** * iio_get_current_scan_type - Get the current scan type for a channel --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 B03ED1C9DFE; Wed, 23 Oct 2024 15:22:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696956; cv=none; b=b7QZQhPdusuojmI8g+m4Hm3revQ1y+7nqDfyt3CYgUMa8Wl5yJ0QplRaREqWtzgpCKCPzgFZk5wOGpMXraiuHRyKW7N09eS+/K0ynMBgcO6sTYDCT3s350C6q4wSy5ID5p5T1Z99l9R0HrWbdkWPCtYPwBzUTdr69s3Cx8rnqFc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696956; c=relaxed/simple; bh=JS+kEPP5+HyuCUo40wT3QZ0dMCeFy8KPcsWr/CNp9Hk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GHaE4W2hmh3FjXIoVxls6Pp7oKByDks+VdA/Pu3cJ50cNrnhM4lZ3lRSs25ZuB6lUnZfN9sGM8z/xycKg0wdMWzf8F0pCAjeRkZA8coZBCtIjvQgNcKCjGqLeU2Sp03IMso5ZIPaaNlYXkYal1mi9qIowuWrl8Qm8RxjOkz58Pc= 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=bOhl9aT2; arc=none smtp.client-ip=198.175.65.11 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="bOhl9aT2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696955; x=1761232955; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JS+kEPP5+HyuCUo40wT3QZ0dMCeFy8KPcsWr/CNp9Hk=; b=bOhl9aT2eaJTF6BwZSyvoRnYUQMArU8jJnNHTNuzCVla8KI5YW0cuX1Q 83cGZ46+QASgYnFt1kEH2rWrG3kHwHOQsGP2QhKde4qjuWJWCpZAQ3QXR ypJm4BWRJVoxd6RXNwrS7BRUwSqyaYf10EiI3WGaGCVM7mvlMrcrgbJI6 WBlqZWt9IqK75NtfrHO6xhJpiISEB74LuADG+WffE4FqLCUW36zIXFA2m i0SgacsyuMsPjL4Pzs7jqO5yVygTnYwMKrGi0Zuz826B6WbzO19Kq9vnv xmzdOj/zxGnmi4p4vUqLaejMQmFUYNsz5Bq5Inv59CngIrb8Hdf1Xfcq2 g==; X-CSE-ConnectionGUID: PCe9FVb+TnKBW3bk+SsoDQ== X-CSE-MsgGUID: EoZyocjZTVGb+C0qH8DN7w== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="39841504" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="39841504" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:56 -0700 X-CSE-ConnectionGUID: JvbUA6o2SgSgoBynn9uDpg== X-CSE-MsgGUID: 9Kwy5JnDQXSJo0m/UapBXQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="80430813" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 23 Oct 2024 08:21:54 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id DFECD4E3; Wed, 23 Oct 2024 18:21:48 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol Subject: [PATCH v1 06/13] iio: accel: mma9551: Replace custom implementation of iio_get_acpi_device_name() Date: Wed, 23 Oct 2024 18:17:29 +0300 Message-ID: <20241023152145.3564943-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" IIO core (ACPI part) provides a generic helper that may be used in the driver. Replace custom implementation of iio_get_acpi_device_name(). Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/accel/mma9551.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/iio/accel/mma9551.c b/drivers/iio/accel/mma9551.c index fa1799b0b0df..a5d20d8d08b8 100644 --- a/drivers/iio/accel/mma9551.c +++ b/drivers/iio/accel/mma9551.c @@ -4,11 +4,11 @@ * Copyright (c) 2014, Intel Corporation. */ =20 -#include #include #include +#include +#include #include -#include #include #include #include @@ -435,17 +435,6 @@ static int mma9551_gpio_probe(struct iio_dev *indio_de= v) return 0; } =20 -static const char *mma9551_match_acpi_device(struct device *dev) -{ - const struct acpi_device_id *id; - - id =3D acpi_match_device(dev->driver->acpi_match_table, dev); - if (!id) - return NULL; - - return dev_name(dev); -} - static int mma9551_probe(struct i2c_client *client) { const struct i2c_device_id *id =3D i2c_client_get_device_id(client); @@ -464,8 +453,8 @@ static int mma9551_probe(struct i2c_client *client) =20 if (id) name =3D id->name; - else if (ACPI_HANDLE(&client->dev)) - name =3D mma9551_match_acpi_device(&client->dev); + else + name =3D iio_get_acpi_device_name(&client->dev); =20 ret =3D mma9551_init(data); if (ret < 0) --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 B1CBF1C876B; Wed, 23 Oct 2024 15:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696955; cv=none; b=hmsFHiNAwNC9sgbke7+0VQoggmzuiEg0wh9/txLuY/dbX1R2MLV56zFRAEtIJe94EZB4iGu/uBRuabmpW8vXvcZAOBoMO9Akye9Dd2WDTFfhlkXmUxWleMLAmgg54Z7rqE9d9NtwGvB3qzSCLYv8ROD0GY4dR5aCi02cqUArq9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696955; c=relaxed/simple; bh=kgbPGnupvACZXY/KCoscd2WgwarUJ/iVo+9QSdYMauM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bn70GEL6ZHBKndwRDS62iZfe+pSoM4/gXHK3FHVdK5IHNtNpbc+3npQasVHKFjBWdAhUnnB7T+7Xn9Q8pxk6aZ+J56WfWJ0uYcdv0MVJ7KEHJEmewZt0EOetTeHbZZRejcPe12F27JK96bBNfW8SHrkPs+IsLA2beZlPGz7b/kY= 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=Z363/QA1; arc=none smtp.client-ip=198.175.65.11 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="Z363/QA1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696954; x=1761232954; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kgbPGnupvACZXY/KCoscd2WgwarUJ/iVo+9QSdYMauM=; b=Z363/QA1KELE9ro4lcv8OTlwFpfevd/CvexrNBGmjlpIHmVkKDnQ5xx0 +kYJyyywf0KuQt1rGcrkspg4Tto8+fV9BUZR00zRh2wsmy9/7AOvcTAu1 gEQofMzrJApUZIXCcSCn4hof2h2Dtad4rZmJJ8dhvksQ6dhVbUFpDC23D GozlHKJAZF6GG9q2mOqigBwVsMY1nnWQtG0QX2BQnyzovMMlMHbjl6Bqq 4bId63Z125Q0alXQ1rYCp0mIirFo/zTE97Wp/jUMMnhyoX8zqe4cqv0Qm YSWr+Lnm0U5rDVDcf3ddvXUbYo+bx+AM3WzLX3p0FhZqA1ipY3mZKJCtr Q==; X-CSE-ConnectionGUID: vSC3RnVdS9uLmFTyQ1MHDg== X-CSE-MsgGUID: 2dwB05gRRWKmYOiSgs+h8A== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="39841491" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="39841491" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:56 -0700 X-CSE-ConnectionGUID: 4LRNR7ivSGSZvRM/bMUslg== X-CSE-MsgGUID: y4rjCJdLTquO1gdcqZDdhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="80430812" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 23 Oct 2024 08:21:54 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EE523550; Wed, 23 Oct 2024 18:21:48 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol Subject: [PATCH v1 07/13] iio: accel: mma9553: Replace custom implementation of iio_get_acpi_device_name() Date: Wed, 23 Oct 2024 18:17:30 +0300 Message-ID: <20241023152145.3564943-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" IIO core (ACPI part) provides a generic helper that may be used in the driver. Replace custom implementation of iio_get_acpi_device_name(). Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/accel/mma9553.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c index 86543f34ef17..1ea6aa007412 100644 --- a/drivers/iio/accel/mma9553.c +++ b/drivers/iio/accel/mma9553.c @@ -4,11 +4,11 @@ * Copyright (c) 2014, Intel Corporation. */ =20 -#include #include #include +#include +#include #include -#include #include #include #include @@ -1062,17 +1062,6 @@ static irqreturn_t mma9553_event_handler(int irq, vo= id *private) return IRQ_HANDLED; } =20 -static const char *mma9553_match_acpi_device(struct device *dev) -{ - const struct acpi_device_id *id; - - id =3D acpi_match_device(dev->driver->acpi_match_table, dev); - if (!id) - return NULL; - - return dev_name(dev); -} - static int mma9553_probe(struct i2c_client *client) { const struct i2c_device_id *id =3D i2c_client_get_device_id(client); @@ -1091,9 +1080,9 @@ static int mma9553_probe(struct i2c_client *client) =20 if (id) name =3D id->name; - else if (ACPI_HANDLE(&client->dev)) - name =3D mma9553_match_acpi_device(&client->dev); else + name =3D iio_get_acpi_device_name(&client->dev); + if (!name) return -ENOSYS; =20 mutex_init(&data->mutex); --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 8221C1ADFF5; Wed, 23 Oct 2024 15:21:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696918; cv=none; b=iXw5HYRqk4M6pHKwhFDtcUsfIhKwxobc8i/Qy/4ztOqVkf93xLjiYLd1aZhhDNmda3T9X1EyvTI/CLcdny25Yh4ygERhX1M75FMO4sW69+utS8jV3gNBGjWPrGoCO7IPU0V0LeGU2BemhuIgBB8T6+p38kVQgMDSozzwSrPNdGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696918; c=relaxed/simple; bh=v2aFdgK6XcZSWP1hJOrhbPXIQXhFFZvYV0bSqCyYMYA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iFzw4GticFHiGs5R6ENi82gPWKiX+T7e9fM5xrqJY/LJL3xB391KftFlB1xGJ3ft3YrgAO/bLx6laszTLj4BrxBBQ70gmsk/urTY3BqewouGKfQgekbpZgAoekixepHCkqJd1ZFHxJJQ5VjZ2XCEmF2ngBd9E2+lZSuhJwPzRH0= 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=FnP8jfpV; arc=none smtp.client-ip=198.175.65.10 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="FnP8jfpV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696917; x=1761232917; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v2aFdgK6XcZSWP1hJOrhbPXIQXhFFZvYV0bSqCyYMYA=; b=FnP8jfpVPDJ/oKAZtNh1eHjDiJ2OKZ6Y551/jZZrIFVBLaOGSAxhNNPn 98r6lqF+j2LiTSz4GnwMS+KZPgvb0Ct8eQR6j1bTsabCTXOjxMtgEGQE7 hwyNH6esBcITFQK6bdE41riDdAZnhODp4ENOC5r3kc463un7qNjuEg+iC 64aWC20Tm+ps6dw1UuVNCzXdDl5SC3m6PsEheRfdu65lJt1JnqR2jzRDG aVHs5hdlnNZDLLBDIsiIFepVMmG+TE6qWgWM8CWuXoUiSK34HLFI54mbk DTqrc6GVLxbof8tco6vEFIkrr3/ylGKAi7j9CY764vcty6A8cH/MgUqOO Q==; X-CSE-ConnectionGUID: tJI85ZE+Soy+VxJbPBAK+Q== X-CSE-MsgGUID: Pl9surWaRzSWhWvbvROycw== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="46757904" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="46757904" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:56 -0700 X-CSE-ConnectionGUID: NLdGGJjOSzirU153mWDuPw== X-CSE-MsgGUID: zlY6Q2PJTxuguX46NN0J3w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="79823541" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 23 Oct 2024 08:21:53 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 04FB6588; Wed, 23 Oct 2024 18:21:48 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol Subject: [PATCH v1 08/13] iio: gyro: bmg160: Replace custom implementation of iio_get_acpi_device_name() Date: Wed, 23 Oct 2024 18:17:31 +0300 Message-ID: <20241023152145.3564943-9-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" IIO core (ACPI part) provides a generic helper that may be used in the driver. Replace custom implementation of iio_get_acpi_device_name(). Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/gyro/bmg160_core.c | 15 --------------- drivers/iio/gyro/bmg160_i2c.c | 4 +++- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c index 10728d5ccae3..499078537fa4 100644 --- a/drivers/iio/gyro/bmg160_core.c +++ b/drivers/iio/gyro/bmg160_core.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -1055,17 +1054,6 @@ static const struct iio_buffer_setup_ops bmg160_buff= er_setup_ops =3D { .postdisable =3D bmg160_buffer_postdisable, }; =20 -static const char *bmg160_match_acpi_device(struct device *dev) -{ - const struct acpi_device_id *id; - - id =3D acpi_match_device(dev->driver->acpi_match_table, dev); - if (!id) - return NULL; - - return dev_name(dev); -} - int bmg160_core_probe(struct device *dev, struct regmap *regmap, int irq, const char *name) { @@ -1098,9 +1086,6 @@ int bmg160_core_probe(struct device *dev, struct regm= ap *regmap, int irq, =20 mutex_init(&data->mutex); =20 - if (ACPI_HANDLE(dev)) - name =3D bmg160_match_acpi_device(dev); - indio_dev->channels =3D bmg160_channels; indio_dev->num_channels =3D ARRAY_SIZE(bmg160_channels); indio_dev->name =3D name; diff --git a/drivers/iio/gyro/bmg160_i2c.c b/drivers/iio/gyro/bmg160_i2c.c index a81814df5205..9c5d7e8ee99c 100644 --- a/drivers/iio/gyro/bmg160_i2c.c +++ b/drivers/iio/gyro/bmg160_i2c.c @@ -17,7 +17,7 @@ static int bmg160_i2c_probe(struct i2c_client *client) { const struct i2c_device_id *id =3D i2c_client_get_device_id(client); struct regmap *regmap; - const char *name =3D NULL; + const char *name; =20 regmap =3D devm_regmap_init_i2c(client, &bmg160_regmap_i2c_conf); if (IS_ERR(regmap)) { @@ -28,6 +28,8 @@ static int bmg160_i2c_probe(struct i2c_client *client) =20 if (id) name =3D id->name; + else + name =3D iio_get_acpi_device_name(&client->dev); =20 return bmg160_core_probe(&client->dev, regmap, client->irq, name); } --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 E29A01C9EB0; Wed, 23 Oct 2024 15:22:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696956; cv=none; b=bEkbxWjMd48rtAZKLnhJ40aoL9iBFiBk6MENSTRgDilxn+h+/1vX/mkOEpRgabF96iVKY43FOSkpP4qb6IQmBMZN2yOShf8osNm5hkaLGpib1U7Epnn5a430fT7QFB1KoHPh4iYFMjfN0s5B6RyzoIH4Jp+0+YXEWmo0WJBmmHk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696956; c=relaxed/simple; bh=9qK8YTmgDasaLPPVFFnxrZN3ShXslQGBdf4tUGHlt4c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lZQ4Ti84SFFi1sQmVCXNyjAWs6YmdvNNnPwvgsCm3Nr75rEgOx/Fa5+UtFI/2Zl9hSAt1bnxKZlo/6SvIIyplE5o2u6OW6uZVChS1FYQrYABmOVmqX8BL0O6qbcrvcg4uMXzR2VKltJ7UHCUYD3unFidcXAUTADlsqpiuYip+5k= 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=HeCY1gOY; arc=none smtp.client-ip=198.175.65.11 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="HeCY1gOY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696955; x=1761232955; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9qK8YTmgDasaLPPVFFnxrZN3ShXslQGBdf4tUGHlt4c=; b=HeCY1gOYtdig4wTsAgqATPtLSxDP72805NnRne/g+2uwDhTa9Mp6X7vz nIFU3pC5KBjG6cLE4xQN5ZmTxH3Ry6k+ZGKzW1XMEkyY8mF4gijAHpauC xHWobOMX+GU1REnM0KWnH+pAkFxRkEpSi3jupFi3vonG3AeLONVdtUCGk xQwiMDEvsId4IL9ErUBePJnvzemo8LjnTuqEmFy4PMqivjeIQF4BY3vc+ PB+dmBzn1DZM9DjyFXujowG4iIKZIEGpcXRVT+XM2VW8QCsoAvQvK4oCR GmnJUG7XZjRurtFDCBhpCimHjQcWaO9tKtjvaToRtNZ+G+AmNp2QXqwPE w==; X-CSE-ConnectionGUID: Ns+HoS9NQ528buwcVrG6+Q== X-CSE-MsgGUID: ppfCN3nYQd6e2K8x08bfvA== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="39841508" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="39841508" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:56 -0700 X-CSE-ConnectionGUID: Bjtkx44jSJevyaLixdk9aw== X-CSE-MsgGUID: w7IYGt4ITiqk85YE2Wg4CQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="80430817" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 23 Oct 2024 08:21:54 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 141D35B8; Wed, 23 Oct 2024 18:21:49 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol Subject: [PATCH v1 09/13] iio: light: isl29018: Replace a variant of iio_get_acpi_device_name_and_data() Date: Wed, 23 Oct 2024 18:17:32 +0300 Message-ID: <20241023152145.3564943-10-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" IIO core (ACPI part) provides a generic helper that may be used in the driver. Replace a variant of iio_get_acpi_device_name_and_data(). Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/light/isl29018.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c index 8dfc750e68c0..526ee5619d26 100644 --- a/drivers/iio/light/isl29018.c +++ b/drivers/iio/light/isl29018.c @@ -687,20 +687,6 @@ static const struct isl29018_chip_info isl29018_chip_i= nfo_tbl[] =3D { }, }; =20 -static const char *isl29018_match_acpi_device(struct device *dev, int *dat= a) -{ - const struct acpi_device_id *id; - - id =3D acpi_match_device(dev->driver->acpi_match_table, dev); - - if (!id) - return NULL; - - *data =3D (int)id->driver_data; - - return dev_name(dev); -} - static void isl29018_disable_regulator_action(void *_data) { struct isl29018_chip *chip =3D _data; @@ -716,9 +702,10 @@ static int isl29018_probe(struct i2c_client *client) const struct i2c_device_id *id =3D i2c_client_get_device_id(client); struct isl29018_chip *chip; struct iio_dev *indio_dev; + const void *ddata; + const char *name; + int dev_id; int err; - const char *name =3D NULL; - int dev_id =3D 0; =20 indio_dev =3D devm_iio_device_alloc(&client->dev, sizeof(*chip)); if (!indio_dev) @@ -731,11 +718,11 @@ static int isl29018_probe(struct i2c_client *client) if (id) { name =3D id->name; dev_id =3D id->driver_data; + } else { + name =3D iio_get_acpi_device_name_and_data(&client->dev, &ddata); + dev_id =3D (intptr_t)ddata; } =20 - if (ACPI_HANDLE(&client->dev)) - name =3D isl29018_match_acpi_device(&client->dev, &dev_id); - mutex_init(&chip->lock); =20 chip->type =3D dev_id; --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 C26561C1AB4; Wed, 23 Oct 2024 15:21:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696920; cv=none; b=aWqeLFdG4gMGhZfTGRm/Q7L0qWj3H0NRl0FBy1ASmm/xBiZ34G2T+K1m14BWPl18ttDwM++DWsdJojlHXoTXH7oPn7ftz1lVgh4fIsVTZa4NZp3kd6rX5+LBNDVrkNokymlVY3pKleBGXJbrLA+UIIRNqP4niTMLeb1B3ifwUCo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696920; c=relaxed/simple; bh=phP+VOTWj0eqwAEgvhhUVcTJJ0XgbStGd6GiA5Wr1BI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iyqIT+AYzzu1a+CLp1H9l5OgLOYsJt66EMdNYwMl7S53vlvZEU6+AUf6Pgod4Tz8znCeSWe0ckgBXq02vW/OK6dadmLNisRJrvYT8KuUp2leloGvqN07ASMiGJqKMKsK4Qmh8YdXl2LhaJTBtoL/A2pJlgknh6UGhJDYXsnsTLk= 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=n1+23id1; arc=none smtp.client-ip=198.175.65.10 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="n1+23id1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696919; x=1761232919; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=phP+VOTWj0eqwAEgvhhUVcTJJ0XgbStGd6GiA5Wr1BI=; b=n1+23id1qwrg5JqZsQCla/8yhqorxWpJevgksfgTn3n8xh0xOFbK2HMf rpVdSfuEAjcg4mEJ+3zn7eTwg3vwEnkodDJfguAzy3plU3G0Sw4UHwSMw CcwjCGw36tLE8wXFX0PC8pOx6N3TwmbYn6SCbSDvVdpicqvi8XXF0nO0w IEXX2INwN8Gtp8Xzr4uSfATIs09rDPl58SEc4iFUz1ZAmw6ImHEmyjN3M UReAJj8Rn2TReuTAI+agmbzFZTUtC4KE0jxpGy86phPJ7+f1mk4+Cx+hm /nPyztBHfm/uGEm4axV/bSNQz986rmHY0j6awoCUvrQSfdeMe05Pt/3Bu A==; X-CSE-ConnectionGUID: 6vw7aXrdRcyxsAm5S0+5bw== X-CSE-MsgGUID: M1j/frN1SiGGQ3WIQUeWWQ== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="46757919" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="46757919" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:56 -0700 X-CSE-ConnectionGUID: avMrQDQsSayuBs/VZYgFMQ== X-CSE-MsgGUID: udqst/3uRQqT9DFKKvPtiw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="79823543" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 23 Oct 2024 08:21:53 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1A29D386; Wed, 23 Oct 2024 18:21:49 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol Subject: [PATCH v1 10/13] iio: light: isl29018: drop ACPI_PTR() and CONFIG_ACPI guards Date: Wed, 23 Oct 2024 18:17:33 +0300 Message-ID: <20241023152145.3564943-11-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" The complexity of config guards needed for ACPI_PTR() is not worthwhile for the small amount of saved data. This example was doing it correctly but I am proposing dropping this so as to reduce chance of cut and paste where it is done wrong. Also drop now unneeded linux/acpi.h include and added linux/mod_devicetable.h for struct acpi_device_id definition. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/light/isl29018.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c index 526ee5619d26..56e1c915af64 100644 --- a/drivers/iio/light/isl29018.c +++ b/drivers/iio/light/isl29018.c @@ -8,17 +8,18 @@ * Copyright (c) 2010, NVIDIA Corporation. */ =20 -#include #include #include +#include +#include #include #include #include #include #include + #include #include -#include =20 #define ISL29018_CONV_TIME_MS 100 =20 @@ -819,15 +820,13 @@ static int isl29018_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(isl29018_pm_ops, isl29018_suspend, isl29018_resume); =20 -#ifdef CONFIG_ACPI static const struct acpi_device_id isl29018_acpi_match[] =3D { {"ISL29018", isl29018}, {"ISL29023", isl29023}, {"ISL29035", isl29035}, - {}, + {} }; MODULE_DEVICE_TABLE(acpi, isl29018_acpi_match); -#endif =20 static const struct i2c_device_id isl29018_id[] =3D { {"isl29018", isl29018}, @@ -841,14 +840,14 @@ static const struct of_device_id isl29018_of_match[] = =3D { { .compatible =3D "isil,isl29018", }, { .compatible =3D "isil,isl29023", }, { .compatible =3D "isil,isl29035", }, - { }, + {} }; MODULE_DEVICE_TABLE(of, isl29018_of_match); =20 static struct i2c_driver isl29018_driver =3D { .driver =3D { .name =3D "isl29018", - .acpi_match_table =3D ACPI_PTR(isl29018_acpi_match), + .acpi_match_table =3D isl29018_acpi_match, .pm =3D pm_sleep_ptr(&isl29018_pm_ops), .of_match_table =3D isl29018_of_match, }, --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 D1E0D1C3050; Wed, 23 Oct 2024 15:21:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696921; cv=none; b=KsBI1J0MX6LJTpAQwx1Xbjammb9H+K5tmjMeJByedAYNltvRRmrqd4M2DxWHFfGf6KiedQ1CzC5hmeBjmD3W6CLMwH5micN431nd+TjfPZbN7hwKGDrW2BuaOWISd/4VZ21lAukZdQ6QyMJKaibcMdIU3NzI26zJWufvLjqsZyE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696921; c=relaxed/simple; bh=jDq1gH5YCUKcq4BcItLXMsB6y4PEq3PrFo3E4XnyPsg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CnGj2XHnEzodDgqYAD+nDpAeWrTXxkd6IkgUZMEMPLCxkvH99AhULuScteqZyK1QQ/+EH7jRN4gv2jqANfnESUhWwWueJqo9qSTbT3EhH+PJ7rV+/9CK2uhgl6M97u1DpBbCrmzJ81e4y5K1lhuIX3FK5f/CySkOBasHGgj+WI0= 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=II0wnrWr; arc=none smtp.client-ip=198.175.65.10 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="II0wnrWr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696920; x=1761232920; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jDq1gH5YCUKcq4BcItLXMsB6y4PEq3PrFo3E4XnyPsg=; b=II0wnrWrh0t8fVhMEnjB+JuojxSQ/PAiX/aENrdxDfZozyctn5N4r7Pm UOL3qC7kkcUHAmPaxrCAME6MaYsCQMXklwJwXAN7YbZgnva5rCm+4ICRf mp6oA65DhB/twygCf2gV51x4z3Cv93fgs9DHjiJu6YM/YmhZufxTxWlhd mL5rlmpI9xCMpX1VuBF4BQZ80kjnps9N+xxryACDwdvXjXWZVQoeoFDJu 3cTgrALNLb5GSJc/vRiokvyYYZeMnebDa1zh8eQ2I5IVJSQNziJYB8el+ DWNUVNhSN0pGx7WWQoWiBIeheWNPWgedCPE63uLiJky0P1GdReObJ1hKt A==; X-CSE-ConnectionGUID: uGjy5etLQESzzkOpyHEYmA== X-CSE-MsgGUID: o+HBFte8RaGIL2SsSgJbCA== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="46757927" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="46757927" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:56 -0700 X-CSE-ConnectionGUID: zUwNeNHhQs6jTkXpENGOVg== X-CSE-MsgGUID: MUdqcuqNSRuuz2DjFLAjsw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="79823545" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 23 Oct 2024 08:21:53 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 24B7E644; Wed, 23 Oct 2024 18:21:49 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol Subject: [PATCH v1 11/13] iio: light: ltr501: Drop most likely fake ACPI IDs Date: Wed, 23 Oct 2024 18:17:34 +0300 Message-ID: <20241023152145.3564943-12-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" The commits in question do not proove that ACPI IDs exist. Quite likely it was a cargo cult addition while doing that for DT-based enumeration. Drop most likely fake ACPI IDs. The to be removed IDs has been checked against the following resources: 1) DuckDuckGo 2) Google 3) MS catalog: https://www.catalog.update.microsoft.com/Search.aspx This gives no useful results in regard to DSDT, moreover, the official vendor ID in the registry for Lite-On is LCI. Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/light/ltr501.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c index 8c516ede9116..3fff5d58ba3c 100644 --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -1610,8 +1610,6 @@ static int ltr501_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(ltr501_pm_ops, ltr501_suspend, ltr501_resu= me); =20 static const struct acpi_device_id ltr_acpi_match[] =3D { - { "LTER0501", ltr501 }, - { "LTER0559", ltr559 }, { "LTER0301", ltr301 }, { }, }; --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 964411CCB21; Wed, 23 Oct 2024 15:22:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696957; cv=none; b=V7ILh9p7Q6BqgHuD6RphT9JzdaqXadaQXGK2k/KmsOsBTdoXVv7FPfy9Z97WC9diETu0wSbYbL5JIGq8owuJMDWoYHJoFq8wccIPTCT6hSXDzTJ4A/lFs+Cw1WNy24yb7Yipg0kX0zmeEN6tu4JsR5/NVXJtyWDbNT5703mYj98= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696957; c=relaxed/simple; bh=NkIV1nzqb7imB9npMg2g1/t1SJVRLG/zDhOXrFCjnwI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ORVdMLx2oG9RGjyBBY6nvZ47bcp3DorqrMJMMe4BvjY/zSWAPNnW8OiTJU3hwMLi4xwXi5+WvzSIJYdqvyuV0ujlbh5lvX/lLIO30c/KztV6fpx9YSHZJYio/FfwJHnkIV5Gw6hxJLjdXdF5JkmHt/sszqsXxp5cX/rSyAI/m5Q= 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=S4hjJHxS; arc=none smtp.client-ip=198.175.65.11 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="S4hjJHxS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696956; x=1761232956; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NkIV1nzqb7imB9npMg2g1/t1SJVRLG/zDhOXrFCjnwI=; b=S4hjJHxSXPPfPEl8hqAMlPNuuKthZAHgCkIDzUaSia1WqGy02zt7/tgT ivnqu2rBKl702DOZwZZm4R128aS4bxYhsp6bTJVeIGHwOyunIPjtZFnAe PDtcrhNQtf6+4mGS819ayo2rkb75YH6TS8sLP1cqQBitDoWoHSnsZCA1C MpBJvtPHyPbbWsRaFdXCkyFIjTLUJyQ0TwTd9Lcgz9ch0VfCElZqiJWC3 ui4fv4XKhoT6qRKHQop52m5qfl8AsdSa8SlmJBhI35la/W8xwwlFiRzSs 0HM353asUM0XnrLEPBiQlR06UgysLiagXL1laeqiiC7+/NAZKvi6aFEoM Q==; X-CSE-ConnectionGUID: GHZRl8iESry4c6dDB51hgw== X-CSE-MsgGUID: ap8sl8OQQUKPmk1NojNizA== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="39841516" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="39841516" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:56 -0700 X-CSE-ConnectionGUID: 90RaMCh7QJycEu4yX+6o3w== X-CSE-MsgGUID: s7YtVG3kT/OQSrVeRmRC9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="80430826" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 23 Oct 2024 08:21:54 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 347ED74C; Wed, 23 Oct 2024 18:21:49 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol Subject: [PATCH v1 12/13] iio: light: ltr501: Add LTER0303 to the supported devices Date: Wed, 23 Oct 2024 18:17:35 +0300 Message-ID: <20241023152145.3564943-13-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" It has been found that the (non-vendor issued) ACPI ID for Lite-On LTR303 is present in Microsoft catalog. Add it to the list of the supported devices. Link: https://www.catalog.update.microsoft.com/Search.aspx?q=3Dlter0303 Closes: https://lore.kernel.org/r/9cdda3e0-d56e-466f-911f-96ffd6f602c8@redh= at.com Reported-by: Hans de Goede Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/light/ltr501.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c index 3fff5d58ba3c..4051d0d9e799 100644 --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -1611,6 +1611,8 @@ static DEFINE_SIMPLE_DEV_PM_OPS(ltr501_pm_ops, ltr501= _suspend, ltr501_resume); =20 static const struct acpi_device_id ltr_acpi_match[] =3D { { "LTER0301", ltr301 }, + /* https://www.catalog.update.microsoft.com/Search.aspx?q=3Dlter0303 */ + { "LTER0303", ltr303 }, { }, }; MODULE_DEVICE_TABLE(acpi, ltr_acpi_match); --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 22:34:29 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (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 9D52C1C9EDC; Wed, 23 Oct 2024 15:22:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696958; cv=none; b=hS6f37pVB++l0U/ESx3P24j9n6LoF5V97ATFiXND+A0gjInUFYZzSUYTVk/H1VmvcsyCG0J1lc4KH2LUiQvBWriABmRT7dgjNF2pXhQr1IHzbNgCiChW84wUOla7MJbVoW96R3GIMMb5g6s2VQ4yJTcsFaUOyvGTNxi1h32oTT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729696958; c=relaxed/simple; bh=Q2rrzZAtm3fm6EOsPSqpPKX95A5SEPcckPpxCpzG8Xg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CJFM8DHMEYfh1q2XJsWm7gQ5/GFFKg259CEirxCoFCRL5/4OyIgttSDAC0Xg2+45KPSY8jrxcHTx+hzm4gTGvuLD4aQBZCZVpfZa6qwmaV5f67SM70iivCMcYqVZA1WXyjnPFmqQ9AaAOfKNB8ff8SEtwK2wT6VRWzf16zIxY4k= 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=I1sETyk8; arc=none smtp.client-ip=198.175.65.11 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="I1sETyk8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729696957; x=1761232957; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q2rrzZAtm3fm6EOsPSqpPKX95A5SEPcckPpxCpzG8Xg=; b=I1sETyk8huOvJQrj5PNn7Zajp7yerKbhXzIqyXhncCl44t5DBMm1m9KO fj+Pniia5anmOOP3alKzs9xXMSi5EokrRlNItjnFDyJ9k5c2qYYrUlEm+ OmkjSq40EfLf2bmjQlHi1d6gdJntWjmLghJI84mI21/pLx3eEijtcVG9P RKldE1tl76V6khsP0fv6xC7Fqy6x8dSQ/l0DJXys6mQMr/4wXykaPH6NH 1ZeoC+c6z5k1jiVXYv/H13F+K5yV7eeUvW1rWoPDpkqxsgfD00/SnQASI yAKlU3c+MZrXoWOkR49MZ31htS0NdWV9HcC9eb2XRQWg4sEoy0xSZoYCH A==; X-CSE-ConnectionGUID: RpyjDyL8RyCARjayTJnNPA== X-CSE-MsgGUID: WNMZ+wWdRGyk4cRjrUwRiw== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="39841526" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="39841526" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2024 08:21:57 -0700 X-CSE-ConnectionGUID: fh0buKkcTXahrPe8s/F0Lg== X-CSE-MsgGUID: NZIDNE+YT8W0bY4lxjIZEg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,226,1725346800"; d="scan'208";a="80430828" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 23 Oct 2024 08:21:54 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3A56A6A7; Wed, 23 Oct 2024 18:21:49 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Jean-Baptiste Maneyrol Subject: [PATCH v1 13/13] iio: light: ltr501: Replace a variant of iio_get_acpi_device_name_and_data() Date: Wed, 23 Oct 2024 18:17:36 +0300 Message-ID: <20241023152145.3564943-14-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241023152145.3564943-1-andriy.shevchenko@linux.intel.com> References: <20241023152145.3564943-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" IIO core (ACPI part) provides a generic helper that may be used in the driver. Replace a variant of iio_get_acpi_device_name_and_data(). Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- drivers/iio/light/ltr501.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c index 4051d0d9e799..c389be6a106d 100644 --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -15,7 +15,6 @@ #include #include #include -#include #include =20 #include @@ -1422,17 +1421,6 @@ static int ltr501_powerdown(struct ltr501_data *data) data->ps_contr & ~LTR501_CONTR_ACTIVE); } =20 -static const char *ltr501_match_acpi_device(struct device *dev, int *chip_= idx) -{ - const struct acpi_device_id *id; - - id =3D acpi_match_device(dev->driver->acpi_match_table, dev); - if (!id) - return NULL; - *chip_idx =3D id->driver_data; - return dev_name(dev); -} - static int ltr501_probe(struct i2c_client *client) { const struct i2c_device_id *id =3D i2c_client_get_device_id(client); @@ -1440,8 +1428,10 @@ static int ltr501_probe(struct i2c_client *client) struct ltr501_data *data; struct iio_dev *indio_dev; struct regmap *regmap; - int ret, partid, chip_idx =3D 0; - const char *name =3D NULL; + int partid, chip_idx; + const void *ddata; + const char *name; + int ret; =20 indio_dev =3D devm_iio_device_alloc(&client->dev, sizeof(*data)); if (!indio_dev) @@ -1523,11 +1513,12 @@ static int ltr501_probe(struct i2c_client *client) if (id) { name =3D id->name; chip_idx =3D id->driver_data; - } else if (ACPI_HANDLE(&client->dev)) { - name =3D ltr501_match_acpi_device(&client->dev, &chip_idx); } else { - return -ENODEV; + name =3D iio_get_acpi_device_name_and_data(&client->dev, &ddata); + chip_idx =3D (intptr_t)ddata; } + if (!name) + return -ENODEV; =20 data->chip_info =3D <r501_chip_info_tbl[chip_idx]; =20 --=20 2.43.0.rc1.1336.g36b5255a03ac