From nobody Mon Nov 25 02:47:47 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 22F7C2141B2; Wed, 30 Oct 2024 16:08:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730304488; cv=none; b=cOGCuMMrQa9L3d3YEhdDFzzqt4qUfTMGlaoH5EFbfKtkxOhZDnYs20Ga6ZYLKaauJu0awWxf0PBcc7yTMfylWLp6TfJOlYOeXg/Rk9B45UhhSJ2Y12+fErYNvBjiy2hWGTonWsypxyG7+XGzIxthHDXgaVKino7H4K8EwPONUzk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730304488; c=relaxed/simple; bh=w5J1pfMR+5EsH4+HYJttJ9rxVRxOBk/FPPHfLvvsJ54=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nrnu3erxP/ozo1HDgx/NP0eJ3POVV7JRH2TUvl6J6P8pNdVA4eCJBl3rj7VY9PJCrvCql0+YtgKrfjk0r9OvDLckvtrOfAWIjOynNDIoufsMipMdS/juJmz/I4xaH94hs/EmRY6V06GTigF5CsZ1NHKmSTW7QKvK7jvIGT0hHw8= 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=kIJXfDLk; arc=none smtp.client-ip=192.198.163.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="kIJXfDLk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730304486; x=1761840486; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w5J1pfMR+5EsH4+HYJttJ9rxVRxOBk/FPPHfLvvsJ54=; b=kIJXfDLk7yvXBCyjQcSic6GaEuFEzd06lpr27u9owMRMfkIWNrADiDCX kHJj29MqPTVn4F5gNIVL/ibiJn7YxN3lF5Xb/jfmKLATNZsiWj+LU3jEJ CGZeMnumotqeovSAzzwZVQbbfWEoZA5B+S1O+3vJG3uFAULlG9gWNkj0r EtXqYiH3nR9PYDKEImEqkaISFS4AQlWQISO7t4J4kyM6cvKnI9NEzZrr2 yQkvCmlpNJeShWI0MXzaU9NDGemXGsNBesMcMkmC9wR+0dMDNSw1qMuD5 huniL7252gszRZyM4fzZv6F7YNEMDKA3NSOVITMkqcW7rzmxeXCzQcGZ4 w==; X-CSE-ConnectionGUID: GSyeAs4MQje20DyVgftTsA== X-CSE-MsgGUID: hOC0GlrnT22CU+83HxeYnQ== X-IronPort-AV: E=McAfee;i="6700,10204,11241"; a="29432046" X-IronPort-AV: E=Sophos;i="6.11,245,1725346800"; d="scan'208";a="29432046" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2024 09:08:02 -0700 X-CSE-ConnectionGUID: 9AqPC5ZZTYeow2Vyzq1x0g== X-CSE-MsgGUID: cm1O6Jr6RzCTEcjFLxByEg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,245,1725346800"; d="scan'208";a="82523848" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 30 Oct 2024 09:08:00 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 53C701CF; Wed, 30 Oct 2024 18:07:58 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen , Dan Carpenter Subject: [PATCH v1 1/4] iio: acpi: Fill data with NULL when iio_get_acpi_device_name_and_data() fails Date: Wed, 30 Oct 2024 18:02:17 +0200 Message-ID: <20241030160756.2099326-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241030160756.2099326-1-andriy.shevchenko@linux.intel.com> References: <20241030160756.2099326-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" Fill data with NULL, if provided, when returning NULL from iio_get_acpi_device_name_and_data(). Note, the current users check for name to be valid, except one case which was initially doing like that and has to be fixed separately. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/54fac4a7-b601-40ce-8c00-d94807f5e214@stan= ley.mountain Fixes: dc60de4eb0a4 ("iio: acpi: Add iio_get_acpi_device_name_and_data() he= lper function") Signed-off-by: Andy Shevchenko --- drivers/iio/industrialio-acpi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio/industrialio-acpi.c b/drivers/iio/industrialio-acp= i.c index d67a43843799..33c737c7a2f8 100644 --- a/drivers/iio/industrialio-acpi.c +++ b/drivers/iio/industrialio-acpi.c @@ -102,13 +102,17 @@ EXPORT_SYMBOL_GPL(iio_read_acpi_mount_matrix); * NOTE: This helper function exists only for backward compatibility, * do not use in a new code! * - * Returns: ACPI device instance name or %NULL. + * Returns: ACPI device instance name or %NULL When returning %NULL, the @= data, + * if provided, will be also initialised to %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; =20 + if (data) + *data =3D NULL; + handle =3D ACPI_HANDLE(dev); if (!handle) return NULL; --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 02:47:47 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 22EC62141D9; Wed, 30 Oct 2024 16:08:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730304486; cv=none; b=mL8yfa/Jp2H8HX2ENPXGt5DnY7Cx0fvSWOqO8klmY0bvRgEfQ0CgWGK3CpG9MSDvl5pjZy15vGLdU3GeNMNl5egbMv/ybbwirbQiYZKs4Z51dyXj5e4BtvCstFovcZcWmjPWTyalwGSEwU78oC1u6XQa4L6WBu2wDkNO1KW2BTQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730304486; c=relaxed/simple; bh=WkPQT/ukvJI7GgfdejYzYLccVooEVQUu2bpNUjOZik4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JNGtdSCxmGko10kYM80vBLxtoa2h+6vFglHtfzmiXPsM0Njs+hvcq86A508Le9ofiwmu0Tde9MEN1da0KQ9953JG3xEhqSVBtPQtNuIsDMD2oSG33SAg3K+US1waD9DrOWhpC4/NluuYvM1gCF37RVvq+50hmJRJKEnafnyfQRc= 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=WK1+4tmH; arc=none smtp.client-ip=192.198.163.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="WK1+4tmH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730304484; x=1761840484; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WkPQT/ukvJI7GgfdejYzYLccVooEVQUu2bpNUjOZik4=; b=WK1+4tmHNv7mrO516kRf36Xv1iI45CgVVyqsQlTBsxreAJuE8UFUFHAj YA3rkUJ3UHaUGabZbIZyFUcgVHie3AT6Xv3DqzDdPwtqQ/THJcsY1PpWA sT9Z8kfCUlZcfg26hyvbx4h8W5zkyO1N8LFrKpJPAuhgjWc8ecNJ2Czp4 Hb/MoNJ7xAiURew1KV4I5PyQVL5xW1NeM69ni/36DsgzTN4lakgdqQWPw VRluinxabmwMQmzCPxUOK/njgHoBCVZwFFlvr8oUOgjqQDiJbra0x8l/e MPG2mpppbmfWysK8Or1fESX188JB0vCCUWsjNWpAqZm1TM+ccCCNwUx5R A==; X-CSE-ConnectionGUID: do3gKsSgTt+JlXGDV46WqA== X-CSE-MsgGUID: clQvgixBTEelijL4eOf9Ug== X-IronPort-AV: E=McAfee;i="6700,10204,11241"; a="29432037" X-IronPort-AV: E=Sophos;i="6.11,245,1725346800"; d="scan'208";a="29432037" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2024 09:08:01 -0700 X-CSE-ConnectionGUID: WXP9EwfiRkywr6CuI23JTw== X-CSE-MsgGUID: YffXdnXnR9SKQGIfU9t5wg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,245,1725346800"; d="scan'208";a="82523847" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 30 Oct 2024 09:08:00 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 608262A0; Wed, 30 Oct 2024 18:07:58 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v1 2/4] iio: accel: kxcjk-1013: Drop duplicate NULL check in kxcjk1013_probe() Date: Wed, 30 Oct 2024 18:02:18 +0200 Message-ID: <20241030160756.2099326-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241030160756.2099326-1-andriy.shevchenko@linux.intel.com> References: <20241030160756.2099326-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 iio_get_acpi_device_name_and_data() always initialises data, if provided, there is no need to have this check in the caller. Drop it. Signed-off-by: Andy Shevchenko --- drivers/iio/accel/kxcjk-1013.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 28ed0e09d099..3d24d4fb6621 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -1507,8 +1507,7 @@ static int kxcjk1013_probe(struct i2c_client *client) data->info =3D (const struct kx_chipset_info *)(id->driver_data); } else { name =3D iio_get_acpi_device_name_and_data(&client->dev, &ddata); - if (name) - data->info =3D ddata; + data->info =3D ddata; if (data->info =3D=3D &kxcj91008_kiox010a_info) indio_dev->label =3D "accel-display"; else if (data->info =3D=3D &kxcj91008_kiox020a_info) --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 02:47:47 2024 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 16AE61E2838; Wed, 30 Oct 2024 16:08:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730304483; cv=none; b=L/vXbKsxtMxIkaMAMOTeabtm+6FOwpVjdMWg5pW8lhXuyifHFW9tuNyox9i5QVvr2zy/XJUe/gomAwupPni0uHAIFqutNVI64L1/QnlMZiTmqEo56dXZAMwLw/+9Im40nReLuVOEs3m36PPgyK3pLM/Dh2ghs0tZ8iawWhFcxrA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730304483; c=relaxed/simple; bh=sG3ot16sMv9t5rM8f8rGAEaq9yO+g6GPx5PBiVGBZvQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=um+OfWfBWv7YxSBGP5pED6Z5e4r9LNqZkSspFleJf9bUZuGaAB+JxyaYm5Dqox2C4nD+V4qp35gezZ4CcNaMN16eWMbnFbNo5vOO/E1KhrqkfpKjgTNlDVL1dIGzptms1hbL26NyeOKB62oPGKLYQts/H4u9nUk4dN8negWLjJM= 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=JFBaNX3w; arc=none smtp.client-ip=198.175.65.16 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="JFBaNX3w" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730304483; x=1761840483; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sG3ot16sMv9t5rM8f8rGAEaq9yO+g6GPx5PBiVGBZvQ=; b=JFBaNX3wSA9Z9dDdybmB5LCjU5QqNa+Wj5bro5LVycYdsZ6dwUlsIvgc rsMaE+eUSjOrCxZ00inLJHz9ORrz/qPo/dCIYfFotFjtJxAu6054ikFog /w/PaRXmXZpH93MeUeHCxNJQEBR2g19LPXjDYxQM0d5LfSFQygNgZNLI5 Vk38GvyLBT1VHuaBMOpY6/PkjKtad54zAzcIdVcjNv84bikuYUB/ZDdTi AmcyBq4JLpIzlQMlKn0Dwqhgl0xSeRjhwmq682tqvEE6Q45uoKfAUxewr i6vYfaEVGianhusCjYhnWvZLtrbKElVobOVedip1zdyWDk2AYUZODhQP/ A==; X-CSE-ConnectionGUID: htsrnKQpSHODfbuVvj3Fkg== X-CSE-MsgGUID: j9T3qg5HRzulIkZISrVCTQ== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="30165101" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="30165101" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2024 09:08:02 -0700 X-CSE-ConnectionGUID: s8IUe0R6THCIt2UwyPMhxA== X-CSE-MsgGUID: 3Ziq6GkVSeO1mMUzfIma2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,245,1725346800"; d="scan'208";a="113212711" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 30 Oct 2024 09:07:59 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6BF8131D; Wed, 30 Oct 2024 18:07:58 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v1 3/4] iio: accel: kxcjk-1013: Deduplicate ODR startup time array Date: Wed, 30 Oct 2024 18:02:19 +0200 Message-ID: <20241030160756.2099326-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241030160756.2099326-1-andriy.shevchenko@linux.intel.com> References: <20241030160756.2099326-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 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 3d24d4fb6621..27c83c17931a 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[] =3D { { } }; =20 -/* KXCJ9-1008 */ -static const struct kx_odr_start_up_time kxcj91008_odr_start_up_times[] = =3D { - { 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[] = =3D { { 0x08, 1240000 }, @@ -325,24 +308,24 @@ static const struct kx_chipset_info kxcjk1013_info = =3D { =20 static const struct kx_chipset_info kxcj91008_info =3D { .regs =3D &kxcjk1013_regs, - .times =3D pm_ptr(kxcj91008_odr_start_up_times), + .times =3D pm_ptr(kxcjk1013_odr_start_up_times), }; =20 static const struct kx_chipset_info kxcj91008_kiox010a_info =3D { .regs =3D &kxcjk1013_regs, - .times =3D pm_ptr(kxcj91008_odr_start_up_times), + .times =3D pm_ptr(kxcjk1013_odr_start_up_times), .acpi_type =3D ACPI_KIOX010A, }; =20 static const struct kx_chipset_info kxcj91008_kiox020a_info =3D { .regs =3D &kxcjk1013_regs, - .times =3D pm_ptr(kxcj91008_odr_start_up_times), + .times =3D pm_ptr(kxcjk1013_odr_start_up_times), .acpi_type =3D ACPI_GENERIC, }; =20 static const struct kx_chipset_info kxcj91008_smo8500_info =3D { .regs =3D &kxcjk1013_regs, - .times =3D pm_ptr(kxcj91008_odr_start_up_times), + .times =3D pm_ptr(kxcjk1013_odr_start_up_times), .acpi_type =3D ACPI_SMO8500, }; =20 --=20 2.43.0.rc1.1336.g36b5255a03ac From nobody Mon Nov 25 02:47:47 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 9D233214415; Wed, 30 Oct 2024 16:08:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730304486; cv=none; b=bPWMtrC/DbILwNcyK4zNe1nsVZdRy9UB3WQ3tUmmkfHjDK8peHPkefCpLT5xzLKyUMyOE7fIR3Tx9ZFI+MKaaYXdEBB/DBsQ/GOmSeCZpD4mHP7hp5xTkIWImAC/Grgx2eON7svjDRdyCxlY6Et1x6pSdZkQF5S0VnJ+5mtZPnU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730304486; c=relaxed/simple; bh=/I07EL93xI7rksnSSU4yB8BeX/oY+UcVmAMhO1n1Wbo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DSEF6W3s1Qef7MktaJtYzZ4xZKPFzywnfng7JB1cPpS2Ybu9hNT18xN7w1D5HD5VJA3AgGR8RWtK+5ydhVD7Qw3scUol2NSEBxdlWDntQmVSbVEOWf3pbqUGWu0aya3bf+Ibqc/QeUllWZyyrdpFqWORq5+eb8oPnLLfMjNeeNY= 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=VxN/BVz9; arc=none smtp.client-ip=192.198.163.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="VxN/BVz9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730304485; x=1761840485; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/I07EL93xI7rksnSSU4yB8BeX/oY+UcVmAMhO1n1Wbo=; b=VxN/BVz9U/5MeCKLcUry687Rujjv7uA9KWByPDvsF7X9GUD8OTm62ezX qWFv5nnTC1W/1KQiiXj8RppHg4yyvrO6JeTzp0PoYxBQ5K9o00a5dhSHK AikVroORQdS/66Wq37wn7ZK3YUiZbSHSZoN3HOg83oCZpjlEntf6VweeV AUdB4dP7ahpZ0LJBIjNNhDOuVm1YxMymM16PCzSffH/ElD3RBGiCh8Q2m VTHVAaDob1jvNz+K/FL99orfy1cg4rWZ+xeH898iyk8uRY2zyxb3nYxlu 7cxS78mO4IdzjYf/SPfEdMQ2An9b1qh6LDpnF6ti4ClATGSy7R9TrGhRt Q==; X-CSE-ConnectionGUID: sSOtmGlEScqSUBlpYq463g== X-CSE-MsgGUID: kG4+N+CCRD2vTpNjKveL0w== X-IronPort-AV: E=McAfee;i="6700,10204,11241"; a="29432042" X-IronPort-AV: E=Sophos;i="6.11,245,1725346800"; d="scan'208";a="29432042" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2024 09:08:02 -0700 X-CSE-ConnectionGUID: jgASKnkcRO+9AJN9sua+yw== X-CSE-MsgGUID: uA8GKIUMTUScsZ8ceuvrsA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,245,1725346800"; d="scan'208";a="82523851" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa006.jf.intel.com with ESMTP; 30 Oct 2024 09:08:00 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 826B0341; Wed, 30 Oct 2024 18:07:58 +0200 (EET) From: Andy Shevchenko To: Jonathan Cameron , Andy Shevchenko , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v1 4/4] iio: light: isl29018: Check if name is valid in isl29018_probe() Date: Wed, 30 Oct 2024 18:02:20 +0200 Message-ID: <20241030160756.2099326-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241030160756.2099326-1-andriy.shevchenko@linux.intel.com> References: <20241030160756.2099326-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" Theoretically the name can be invalid if device has an ACPI handle but hadn't been matched via ACPI ID table. This should never happen, but let's make code very slightly more robust as some other drivers do. Fixes: dc4ecaf21c4a ("staging: iio: light: isl29018: add ACPI support") Depends-on: 14686836fb69 ("iio: light: isl29018: Replace a variant of iio_g= et_acpi_device_name_and_data()") Signed-off-by: Andy Shevchenko --- drivers/iio/light/isl29018.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c index cbe34026bda6..938fc19cfe59 100644 --- a/drivers/iio/light/isl29018.c +++ b/drivers/iio/light/isl29018.c @@ -723,6 +723,8 @@ static int isl29018_probe(struct i2c_client *client) name =3D iio_get_acpi_device_name_and_data(&client->dev, &ddata); dev_id =3D (intptr_t)ddata; } + if (!name) + return -ENODEV; =20 mutex_init(&chip->lock); =20 --=20 2.43.0.rc1.1336.g36b5255a03ac