From nobody Mon Nov 25 22:55:56 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 59FAC224B50; Thu, 24 Oct 2024 19:12:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729797140; cv=none; b=UKhJk8FUBT3Kusqrb2JaDkOkEk7XDmB1l7x2OO+29uT4RLchU7n+h704o5MW+KsWbwPkMFPXoUrLkDKGSTknESzUy0pYDknpHbasHP7ouq+7EILOfiqNHkYTPGIRN5Urt6HSYSBoQV9pQ44wlBgLCPcrPLvZyY/Z+z5rknrMb0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729797140; c=relaxed/simple; bh=7VD/YZ3dxyXfp5F1cccl2DO7mfRb7DzapOk2MWXOIuI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AP73UnYn20oJL52iABsfEtC5oy7GG/hpU5r0clEPuOL3upzWNp2JmNQdxyQsngLgG/yw23jTXfZuM5ZW7SpzSO9krOz+aDYG1tabYAduyE/RPJFZ9toKNhHyLGzPM3ovF6u4X5u7gvwAv8j7s1CUnbuCR6Bb9g5T4iEgsRDahbU= 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=g//6B/qC; arc=none smtp.client-ip=192.198.163.8 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="g//6B/qC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729797138; x=1761333138; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7VD/YZ3dxyXfp5F1cccl2DO7mfRb7DzapOk2MWXOIuI=; b=g//6B/qC0FEdNpzuI6vMs4gfoWm+Rz2bLVHHVl+AgdTsl1b0aSmug/Dz O4usGf7RM36+8KseG3lVBkOXB+71NL+0RV2bVDEPeSu1NRSusLdjCPJ0H NEo7Pr5ZqBBcK5p4TGKQ7rj5YKoYgRlALBikQYzHAaadJ5GteBZ7vifpN qpTjM6DymS/Q8/ZW7E9eq6yHh7Pd1PROVk33RXMKxqgZhGxtAnh52Tg6G em0pspz0gV/CaDk1Y6On2rlLYA79sAu5N1aQKBiySnV8MrpdB/4WbdTrm CMEKPvnYRBc/Y7RluNAJEqnhIFnTTX7+sBjcbgvjhPSD/+VKBTfbcDOk4 g==; X-CSE-ConnectionGUID: NuxNraqOT/CvjZEiuqm/4w== X-CSE-MsgGUID: w8X8LHztQmK8HwdkOzV4bA== X-IronPort-AV: E=McAfee;i="6700,10204,11235"; a="46934537" X-IronPort-AV: E=Sophos;i="6.11,230,1725346800"; d="scan'208";a="46934537" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2024 12:12:11 -0700 X-CSE-ConnectionGUID: 4wmZuixmRzy1i2nqX7mz1g== X-CSE-MsgGUID: FGzQ+BlfSQCF8+sBwp8w7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,230,1725346800"; d="scan'208";a="80266718" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 24 Oct 2024 12:12:08 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EE9DC8EC; Thu, 24 Oct 2024 22:12:01 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Jonathan Cameron , Marius Cristea , Trevor Gamblin , Jean-Baptiste Maneyrol , Hans de Goede , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jonathan Cameron , Lars-Peter Clausen Subject: [PATCH v3 19/24] iio: gyro: bmg160: Replace custom implementation of iio_get_acpi_device_name() Date: Thu, 24 Oct 2024 22:05:08 +0300 Message-ID: <20241024191200.229894-20-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241024191200.229894-1-andriy.shevchenko@linux.intel.com> References: <20241024191200.229894-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(). Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko --- 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