From patchwork Sun Feb 11 20:14:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13552609 Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (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 75B7A5EE8E for ; Sun, 11 Feb 2024 20:15:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707682540; cv=none; b=Tb4eK3ZHwgsN4VmZb7cUee/BAVWWfNGdBKxRiuD2eLB1BlH2vMT60vS87/exDFBQ0akq6CyroGuJmeEartPhL5rb6IV/09C/wt3c7icxtNEXQUej5wu4jvTo+lT4kgxkln27IWgiUXa5WncyBhZxmggooAGXrIKV1tam7h190yw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707682540; c=relaxed/simple; bh=z8WXcKJKVkJaLkn3KQjBR/J4AwDXnhP2TVi4sMS42i4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uOhdVq31dyHamuZsNV5gw+I9MhcDWIxeLFxelLeBvLQlbFIFUlwGBDM+IYNDUQ1gvJ543pHbKuG74Gnfmod7JxHDEIDgSVLJLO/Mlqrg32+Z1R448Ghq+FOA0Cf2z4tJ6ykL7sxYAcT/n6+xQYvmOweC1+KReYNfWAG/kbQt+vg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 4d855663-c91a-11ee-abf4-005056bdd08f; Sun, 11 Feb 2024 22:15:30 +0200 (EET) From: andy.shevchenko@gmail.com To: Andy Shevchenko , Marius Hoch , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v1 1/3] iio: st_sensors: lsm9ds0: Use dev_err_probe() everywhere Date: Sun, 11 Feb 2024 22:14:32 +0200 Message-ID: <20240211201526.1518165-2-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240211201526.1518165-1-andy.shevchenko@gmail.com> References: <20240211201526.1518165-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use dev_err_probe() everywhere where it is appropriate. Signed-off-by: Andy Shevchenko --- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c index e887b45cdbcd..7b9dc849f010 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c @@ -25,10 +25,9 @@ static int st_lsm9ds0_probe_accel(struct st_lsm9ds0 *lsm9ds0, struct regmap *reg struct st_sensor_data *data; settings = st_accel_get_settings(lsm9ds0->name); - if (!settings) { - dev_err(dev, "device name %s not recognized.\n", lsm9ds0->name); - return -ENODEV; - } + if (!settings) + return dev_err_probe(dev, -ENODEV, "device name %s not recognized.\n", + lsm9ds0->name); lsm9ds0->accel = devm_iio_device_alloc(dev, sizeof(*data)); if (!lsm9ds0->accel) @@ -51,10 +50,9 @@ static int st_lsm9ds0_probe_magn(struct st_lsm9ds0 *lsm9ds0, struct regmap *regm struct st_sensor_data *data; settings = st_magn_get_settings(lsm9ds0->name); - if (!settings) { - dev_err(dev, "device name %s not recognized.\n", lsm9ds0->name); - return -ENODEV; - } + if (!settings) + return dev_err_probe(dev, -ENODEV, "device name %s not recognized.\n", + lsm9ds0->name); lsm9ds0->magn = devm_iio_device_alloc(dev, sizeof(*data)); if (!lsm9ds0->magn) @@ -80,8 +78,7 @@ int st_lsm9ds0_probe(struct st_lsm9ds0 *lsm9ds0, struct regmap *regmap) ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(regulator_names), regulator_names); if (ret) - return dev_err_probe(dev, ret, - "unable to enable Vdd supply\n"); + return dev_err_probe(dev, ret, "unable to enable Vdd supply\n"); /* Setup accelerometer device */ ret = st_lsm9ds0_probe_accel(lsm9ds0, regmap); From patchwork Sun Feb 11 20:14:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13552608 Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (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 75BAE5EE92 for ; Sun, 11 Feb 2024 20:15:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707682540; cv=none; b=nbUP7q+rEAzczT7MGQ4TNds9clXEOSs9aygtSdgBZLTLcAgdf86UNjsycFU2yV5au4xEp72HgSk1HRmMIdTLfak4lL7FMvJqaB5eLjBWUJT4y3sPtCIZgIaQ/FJDAOinFFJvdq0aWnvJmO6j/vvb8utfrd4wYZCGahz2j9GIZ3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707682540; c=relaxed/simple; bh=ZrHIuQSM8iDm77EAadM1fDiTchD/AxV8beVPT6IGqLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GlYLuElBB8FtlfRoF1Th6Ea/wdPq/3PMJSUghIVVIVLtsVIV0t4VOLnK0VoXbP6rrDeie+5nvjdZ5MKSxSdYKxlMete5GuSaVVwympJyCFp+F6pOSB5fTNuqf1X/AOGycs1EBSb0kkJ3BMrWkE4H0BAHgwD9NFfAQSNM5vQ5SZ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 4e07fa90-c91a-11ee-abf4-005056bdd08f; Sun, 11 Feb 2024 22:15:31 +0200 (EET) From: andy.shevchenko@gmail.com To: Andy Shevchenko , Marius Hoch , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v1 2/3] iio: st_sensors: lsm9ds0: Don't use "proxy" headers Date: Sun, 11 Feb 2024 22:14:33 +0200 Message-ID: <20240211201526.1518165-3-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240211201526.1518165-1-andy.shevchenko@gmail.com> References: <20240211201526.1518165-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Update header inclusions to follow IWYU (Include What You Use) principle. Signed-off-by: Andy Shevchenko --- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h | 5 ++++- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 4 ++-- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 4 +++- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h index 76678cdefb07..e67d31b48441 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h @@ -4,9 +4,12 @@ #ifndef ST_LSM9DS0_H #define ST_LSM9DS0_H -struct iio_dev; +struct device; +struct regmap; struct regulator; +struct iio_dev; + struct st_lsm9ds0 { struct device *dev; const char *name; diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c index 7b9dc849f010..10c1b2ba7a3d 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c @@ -7,10 +7,10 @@ * Author: Andy Shevchenko */ -#include +#include +#include #include #include -#include #include #include diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c index 61d855083aa0..ab8504286ba4 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c @@ -7,8 +7,10 @@ * Author: Andy Shevchenko */ +#include +#include +#include #include -#include #include #include #include diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c index 8cc041d56cf7..69e9135795a3 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c @@ -7,7 +7,9 @@ * Author: Andy Shevchenko */ -#include +#include +#include +#include #include #include #include From patchwork Sun Feb 11 20:14:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13552606 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (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 3C7925DF21 for ; Sun, 11 Feb 2024 20:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707682535; cv=none; b=d5t8JkHPA8WoyD4GhGo+8oeXwYd8kO9c5z9BS2Mhdb6oC+sZE3aDRtXvL2ZkyU02g8jwqid0PTtZ0BuKKeH6RFpzGoTem/kKZsIUuyeEZK96vgNjdzrUylNCA0jBMUnqpMxpzMTI17Y8H5uQYYfrSKsZ2cKAcBeF+CPpUnbo4+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707682535; c=relaxed/simple; bh=5XIv07/wKtmBMOxCIJedyIk4CrP17JzQEnwYP4BIfKU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P1S31RoryHsvUVfLH+WcUFPwOTwNKGCSVLKDdI+G0sQ/6Oaa7a1Fj+Ozw+6aEOzwybkpRZJd03rBIup195agSiA8WgJpsKSlAP+yL9qZqNweZIvRZKSjOyhZhm3K2Z9u0XuAsU1aiPGf804f/i4yFSXYqo6qxecymnQjdg3DV0c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 4e677400-c91a-11ee-b972-005056bdfda7; Sun, 11 Feb 2024 22:15:32 +0200 (EET) From: andy.shevchenko@gmail.com To: Andy Shevchenko , Marius Hoch , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v1 3/3] iio: st_sensors: lsm9ds0: Use common style for terminator in ID tables Date: Sun, 11 Feb 2024 22:14:34 +0200 Message-ID: <20240211201526.1518165-4-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240211201526.1518165-1-andy.shevchenko@gmail.com> References: <20240211201526.1518165-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use common style for a terminator entry in the ID tables. Signed-off-by: Andy Shevchenko --- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c index ab8504286ba4..d03cec3b24fe 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c @@ -41,7 +41,7 @@ MODULE_DEVICE_TABLE(i2c, st_lsm9ds0_id_table); static const struct acpi_device_id st_lsm9ds0_acpi_match[] = { {"ACCL0001", (kernel_ulong_t)LSM303D_IMU_DEV_NAME}, - { }, + {} }; MODULE_DEVICE_TABLE(acpi, st_lsm9ds0_acpi_match);