From patchwork Fri Nov 1 13:16:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13859344 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 7287D4503C; Fri, 1 Nov 2024 13:17:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730467035; cv=none; b=i0V/+afueMBGod/GxFurUIsbYbVcseNzboJC0qaJMcgPgrKFUaE4dMMaKTyKp33WPqAxromulPZpsBmao6a+PkIBU7oMCboAsCgZr9v0DoSwiN+j+UAP5PsTq/7FXrc5Nyc9EhaJry7mdIavDZNn0uhzgmKOUFon9B4lojCWhkM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730467035; c=relaxed/simple; bh=dju4LAP4QTdsPDNP1GHQ1R4Awpczpb0FwVCmmtIPoE0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pHqyq75F8J3dyHoXqYfoAcSDkme7AX6PXKvRAALWWH+O52iRttEE20rBEEp3tUUL2UZNWlrQcqL7ibhVJTdaNXhOa8CpFjiyAMbGOz7YIyS0OCETazOdr7S2z4PwQRzw+DfwBmVvQxqnDfMMgLAkWm6zKmoDyFcEMMg2dLFhCvY= 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=JG7KG6NJ; arc=none smtp.client-ip=198.175.65.15 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="JG7KG6NJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730467034; x=1762003034; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dju4LAP4QTdsPDNP1GHQ1R4Awpczpb0FwVCmmtIPoE0=; b=JG7KG6NJiuK1HaFMPrk0KskEW5nq1Sv6k/gaqHfrkiH67q+NfxTyQAI0 ncYlKtPWx9nhmmr9Mq5k3Ll93jxsH4euQgVXBKePMmxfSVrGt6gT/ROB5 7Xhplw46y/xdFMTuqxcPuaO+pm8b6umTZzzKgVHyOY2M0nzh8yOqKwj/F WePyeWC0RG6FRrjSBZPavNlL3QKQ0yQBBtPwaOb5OhfG+XRLBIKZACX7t mYl9RN1cXI47iTbsSKW30SSo45jpAmEMXWvKp63FOZcvHjEsKxPdSSsjl FksLRg7boWHvAMWB6D8+kaW9ALlhpIKlvdemATfHX2z+40+G3ru4pos26 w==; X-CSE-ConnectionGUID: h+chALQFS9uPg63XwKoLKQ== X-CSE-MsgGUID: TZcR7D+YRV27N6UDWR7T1Q== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="33920655" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="33920655" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 06:17:11 -0700 X-CSE-ConnectionGUID: 94z10vAnQhuht2Di7MimOA== X-CSE-MsgGUID: /6g0SziUR62Iz/qqlYdDiQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="87754310" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa003.jf.intel.com with ESMTP; 01 Nov 2024 06:17:10 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 281F693; Fri, 01 Nov 2024 15:17:08 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Dan Carpenter Subject: [PATCH v3 1/4] iio: light: isl29018: Assign NULL to ddata in isl29018_probe() Date: Fri, 1 Nov 2024 15:16:01 +0200 Message-ID: <20241101131705.3697913-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101131705.3697913-1-andriy.shevchenko@linux.intel.com> References: <20241101131705.3697913-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When iio_get_acpi_device_name_and_data() fails, the ddata may be left uninitialised. Initialise it to NULL. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/54fac4a7-b601-40ce-8c00-d94807f5e214@stanley.mountain Fixes: 14686836fb69 ("iio: light: isl29018: Replace a variant of iio_get_acpi_device_name_and_data()") Signed-off-by: Andy Shevchenko --- drivers/iio/light/isl29018.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c index cbe34026bda6..201eae1c4589 100644 --- a/drivers/iio/light/isl29018.c +++ b/drivers/iio/light/isl29018.c @@ -703,7 +703,7 @@ static int isl29018_probe(struct i2c_client *client) const struct i2c_device_id *id = i2c_client_get_device_id(client); struct isl29018_chip *chip; struct iio_dev *indio_dev; - const void *ddata; + const void *ddata = NULL; const char *name; int dev_id; int err; From patchwork Fri Nov 1 13:16:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13859345 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 90179195811; Fri, 1 Nov 2024 13:17:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730467036; cv=none; b=MH5ji4uqrj3qCyorZgtlfyXXkGK92+8GWt6Y62S4ZyAdhiLFuqKtZvzkmp6EZQ/g/oPFRxx72eDzlGecWw30Vmr5fTTA9qo8/Nr5zxdVihR+sC7Edp6uwGMj2Tc+m1ZxNaRKba+OIv+PWkot6jXqVzDqARUDoeGSLDP/NOz4E2A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730467036; c=relaxed/simple; bh=zb/4/bFX10GCalAWVbRwK1NHWuKv704m0q1ZHqlV4MM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gyngTB8O1uoDBeg7dk+fR7C1vUZbOkf7+dueTU3+pvwp+McS4BcCfQlo8G5tc/hV7XGw0P+d1/HmUqN1EKfk8MuVURjRy4f9oTLo4YHeBPDU8zFZ60dYSfbM6iftywjLozDZinGT1go7q9ZVbnw4p7wZQVwsdLIj0bdEceDgRm4= 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=P2fsHLML; arc=none smtp.client-ip=198.175.65.19 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="P2fsHLML" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730467033; x=1762003033; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zb/4/bFX10GCalAWVbRwK1NHWuKv704m0q1ZHqlV4MM=; b=P2fsHLMLCuBCeaCkMyZW333QaU9wUTfPA+HG18NKPA5HuJ1bKW6831wV dS/xydRcnKJ5rENrjmHsFXPITXdBLO4cy9jhYkzyx32UOcHcanyMP2POD 3ZVQIoP9wkCPw6RWJiVVwS6pi2qooh6bwdut0AdzmlHh3D+9fGJK4+t5e tHoA3Uez/NYpL9dQfXGAW4kkbXACq/toAxYYD51gP46qX1CrSyrdOHrDf HrwwqolWoLev21VDmINUzDxbEVbhEDLqtXz5F/UdBiAaNdEmmG+/C+395 KPFK2RI9v3Ny3VAcbE7tN/+/uovUMvDsXa8CxF0yUDnUGN4HYge8q4B5/ A==; X-CSE-ConnectionGUID: wm8RaoR9Qua9HSk5wp6CFA== X-CSE-MsgGUID: 4rjonPSpQreaUstr3f4c7A== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="30088451" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="30088451" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 06:17:11 -0700 X-CSE-ConnectionGUID: l0OJ6fyyS3WeV8QytZGIcw== X-CSE-MsgGUID: xGC0gNFeSb+w03fa+4FomA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="83100793" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 01 Nov 2024 06:17:10 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 321C62AF; Fri, 01 Nov 2024 15:17:08 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Dan Carpenter Subject: [PATCH v3 2/4] iio: light: ltr501: Assign NULL to ddata in ltr501_probe() Date: Fri, 1 Nov 2024 15:16:02 +0200 Message-ID: <20241101131705.3697913-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101131705.3697913-1-andriy.shevchenko@linux.intel.com> References: <20241101131705.3697913-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When iio_get_acpi_device_name_and_data() fails, the ddata may be left uninitialised. Initialise it to NULL. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/54fac4a7-b601-40ce-8c00-d94807f5e214@stanley.mountain Fixes: 61da460b813d ("iio: light: ltr501: Replace a variant of iio_get_acpi_device_name_and_data()") Signed-off-by: Andy Shevchenko --- drivers/iio/light/ltr501.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c index 7228611d4c59..616dc6921702 100644 --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -1424,8 +1424,8 @@ static int ltr501_probe(struct i2c_client *client) struct ltr501_data *data; struct iio_dev *indio_dev; struct regmap *regmap; + const void *ddata = NULL; int partid, chip_idx; - const void *ddata; const char *name; int ret; From patchwork Fri Nov 1 13:16:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13859342 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 95A77168DA; Fri, 1 Nov 2024 13:17:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730467033; cv=none; b=kgWmUfFBocrDCv6MLqB1Y8HOZc3m7ofbFwICdIgQX6GzkDttw5EfBEk8YwqYQciY3VCbnA9+bQ86yuXGrspltcLIuQsLTyvVyS4avL3sngSEbBlKgv9KSA0ZvUhc2ybUjINdJNeybsnekAQtZSR4PAYb1AKcOFrjXKFH1PRR75E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730467033; c=relaxed/simple; bh=aOLbCzDG18JjRhWg9vu/kyWY/YfLn12G2M8765yV5HA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dHV+fhQ1zrZGs/oes3T82DM5s9KtTcE5l54/3fvFRPlECC1fict43v33uER+S3dcfkhhT5xsryGxZ3MOAWeebkZfVnGYnOBWkr6bTHXaneQbKShv1a3Ua3uLbiKDve+sLCUqCzibq8AffxEUMdiiSKyXu8LbCQWd0IC45fbVc80= 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=TUI+DQYx; arc=none smtp.client-ip=198.175.65.19 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="TUI+DQYx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730467031; x=1762003031; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aOLbCzDG18JjRhWg9vu/kyWY/YfLn12G2M8765yV5HA=; b=TUI+DQYx6cqVbVx4L/kfJ9ZXRR8isflgzHbzfspbM50jf6EFYEXUZ4KV vR2VD/Z9RSh4l+cFhvNUsq3RiFmUw6zzvf+YJYwj4pNylbkxNXojvFx+4 Hp50swtD29LarIIWSLCH5NqJlsLQ/nQnE7KPSalcZmQtXVzuiUDYD1evx CnCAeV2xDSsWzxFCw4/IgT5mccTFDw9J41Gzr6T6Byjb3kNDvKn6hi9KC dYfAa1v6uXngPeX4+n+DzaNg/1mQt1MTbXbzlRB1idL33+IuEq7InyzQ7 3KHpwHnyfqxnnrqfydXZIXiGXmpWP4Y9eqUQsDzr1eRnWkaIaOQI0O90A w==; X-CSE-ConnectionGUID: +SgEuXhyRgq5uwWmwzfFCw== X-CSE-MsgGUID: RBVKqQNSSvS88K0n/Nr9Mw== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="30088447" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="30088447" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 06:17:11 -0700 X-CSE-ConnectionGUID: ICmC6/MhQ3WEu5u1eNIjZw== X-CSE-MsgGUID: /E9M4tpNSQmtymv1thRh/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="83100792" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 01 Nov 2024 06:17:10 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 458BF357; Fri, 01 Nov 2024 15:17:08 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v3 3/4] iio: accel: kxcjk-1013: Assign NULL to ddata in kxcjk1013_probe() Date: Fri, 1 Nov 2024 15:16:03 +0200 Message-ID: <20241101131705.3697913-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101131705.3697913-1-andriy.shevchenko@linux.intel.com> References: <20241101131705.3697913-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When iio_get_acpi_device_name_and_data() fails, the ddata may be left uninitialised. Initialise it to NULL and drop unneeded NULL check in kxcjk1013_probe(). Signed-off-by: Andy Shevchenko --- drivers/iio/accel/kxcjk-1013.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 28ed0e09d099..753ec2f71a9a 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -1462,7 +1462,7 @@ static int kxcjk1013_probe(struct i2c_client *client) struct kxcjk1013_data *data; struct iio_dev *indio_dev; struct kxcjk_1013_platform_data *pdata; - const void *ddata; + const void *ddata = NULL; const char *name; int ret; @@ -1507,8 +1507,7 @@ static int kxcjk1013_probe(struct i2c_client *client) data->info = (const struct kx_chipset_info *)(id->driver_data); } else { name = iio_get_acpi_device_name_and_data(&client->dev, &ddata); - if (name) - data->info = ddata; + data->info = ddata; if (data->info == &kxcj91008_kiox010a_info) indio_dev->label = "accel-display"; else if (data->info == &kxcj91008_kiox020a_info) From patchwork Fri Nov 1 13:16:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13859343 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 50D54381B9; Fri, 1 Nov 2024 13:17:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730467035; cv=none; b=iTj2uPtJir/BbgI1tH6TtVvVeUd7TLT0mXUDu5QwcPdTZ/ZACoIkN+6iyQIq66BbN5B4MGETV/CzTgJT66IAD6W2RqL+a82hzsYGOu4RUVw5OxXwMvWHzEg0eFhxuVqXpbLJEh6EKmV8F+KUL3zp8LSnUNJKzSsCC9+G9SG7myc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730467035; c=relaxed/simple; bh=fBv79w3eKoOjs9m//MWJ8cMaBmRaNg6AHgoFuopBHP4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PFu01vpiQTyw/5d2FmY/TeUdXdsxj9WIVi/VmEGQjbY/XiUpgPtl8IG/AOW979ovlLoMvDHtYRnpNlS5VpSlAPUHddQnrbO8NVEb2agzzDRdX6Q5N6vXZArJ0FtNDg7uNgDpX64ofcta9AnMxmKCwoMkNW62cKeLmcQdVYCE1c4= 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=aiTMuVOi; arc=none smtp.client-ip=198.175.65.15 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="aiTMuVOi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730467033; x=1762003033; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fBv79w3eKoOjs9m//MWJ8cMaBmRaNg6AHgoFuopBHP4=; b=aiTMuVOihFb+YNsXWFprJMkwY1Du9CtPjFSyebg89mfN09TwGMuw/OAl km9oG9F271zJLmnbAavOlUqqmQfcpSJUCQiqPjX9pDoHmc847t67Wh+d2 8/JNwJBzJIG9FI1igzoE1044JSaXBEMey4ckCSPQ7spPTZyPOnWZvxNnF /FrEResljZ/akYKr2UCAVywaMPvftMXWTFQx32EKXHOwzgasCklFZ5zUJ 8safOvf7+WSdWO6ms5Tu13+CNMw/lK5QDeixW0Mcp5nvbm1BFir9dmikF 3JocmRyM1ufr+IJJuLLvxcDnQ2pDhqJRpc0OiPM2SX6ELYGhEYJSh3etF Q==; X-CSE-ConnectionGUID: GwKNAQNJRwubVYGZFp1lUw== X-CSE-MsgGUID: LRVg380qRe6ueUm7m7k9pw== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="33920651" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="33920651" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 06:17:11 -0700 X-CSE-ConnectionGUID: BZCaD6QaRoOz5OYelz7f9g== X-CSE-MsgGUID: /HLlG+NxTmqV1fEAG9KjgQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="87754309" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa003.jf.intel.com with ESMTP; 01 Nov 2024 06:17:10 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4F0CB2D3; Fri, 01 Nov 2024 15:17:08 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v3 4/4] iio: accel: kxcjk-1013: Deduplicate ODR startup time array Date: Fri, 1 Nov 2024 15:16:04 +0200 Message-ID: <20241101131705.3697913-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101131705.3697913-1-andriy.shevchenko@linux.intel.com> References: <20241101131705.3697913-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The content of kxcj91008_odr_start_up_times and kxcjk1013_odr_start_up_times is identical, deduplicate it. Signed-off-by: Andy Shevchenko --- drivers/iio/accel/kxcjk-1013.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 753ec2f71a9a..f65fde06f2c1 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -193,23 +193,6 @@ static const struct kx_odr_start_up_time kxcjk1013_odr_start_up_times[] = { { } }; -/* KXCJ9-1008 */ -static const struct kx_odr_start_up_time kxcj91008_odr_start_up_times[] = { - { 0x08, 100000 }, - { 0x09, 100000 }, - { 0x0A, 100000 }, - { 0x0B, 100000 }, - { 0x00, 80000 }, - { 0x01, 41000 }, - { 0x02, 21000 }, - { 0x03, 11000 }, - { 0x04, 6400 }, - { 0x05, 3900 }, - { 0x06, 2700 }, - { 0x07, 2100 }, - { } -}; - /* KXCTJ2-1009 */ static const struct kx_odr_start_up_time kxtj21009_odr_start_up_times[] = { { 0x08, 1240000 }, @@ -325,24 +308,24 @@ static const struct kx_chipset_info kxcjk1013_info = { static const struct kx_chipset_info kxcj91008_info = { .regs = &kxcjk1013_regs, - .times = pm_ptr(kxcj91008_odr_start_up_times), + .times = pm_ptr(kxcjk1013_odr_start_up_times), }; static const struct kx_chipset_info kxcj91008_kiox010a_info = { .regs = &kxcjk1013_regs, - .times = pm_ptr(kxcj91008_odr_start_up_times), + .times = pm_ptr(kxcjk1013_odr_start_up_times), .acpi_type = ACPI_KIOX010A, }; static const struct kx_chipset_info kxcj91008_kiox020a_info = { .regs = &kxcjk1013_regs, - .times = pm_ptr(kxcj91008_odr_start_up_times), + .times = pm_ptr(kxcjk1013_odr_start_up_times), .acpi_type = ACPI_GENERIC, }; static const struct kx_chipset_info kxcj91008_smo8500_info = { .regs = &kxcjk1013_regs, - .times = pm_ptr(kxcj91008_odr_start_up_times), + .times = pm_ptr(kxcjk1013_odr_start_up_times), .acpi_type = ACPI_SMO8500, };