From nobody Mon Nov 25 23:44:42 2024 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (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 87B741E04BD; Thu, 24 Oct 2024 13:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729775088; cv=none; b=quHyAxX/25x+MOFRvDcmA//fs7zzt8l+AoofUwP1hLED/fSbwSeF5ce0kJ2C2n3neBAwm+jOqTTR7/X2KFACzfjdj6ouPdHt8/dlFsMo3Wqxkh5+P2o7y3dg26C667+Wt3ELc0Vqyixke/yTrJI60o4YXMu0bWRdR34h90ABjoY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729775088; c=relaxed/simple; bh=QjdeYHP6bLRULSx5x70pbUZ1lUja1ExHACvu0ZrgtZU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N1LKRCtfcLfGB2SzbJRQCuPEIl0Cq+ykFc3tG+HuWQxfkLELxKoR6Po8r5JEy8fnXOAJ/RVk64HzfuLJFQQRk8gHzLJT+9yoWLTk/9BnyVy+p24CJM3UNQwFYQlkcVypvy4vnQyKE03Ni42pgeKnDX8B4Oe8JqMTRUHFrMBq2Ao= 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=TsBq7bBt; arc=none smtp.client-ip=192.198.163.7 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="TsBq7bBt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729775087; x=1761311087; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QjdeYHP6bLRULSx5x70pbUZ1lUja1ExHACvu0ZrgtZU=; b=TsBq7bBtGy1MzYm6ny/Oqa+eFRbfKGFS7gTVjpVpzNFXMJQSEJjmceQg UpVN1/2Q2xbeu1UUjW3Vzxwg0AmoQKS00lHLMQLtGegmWUfVeVE7oQRdm 5gvqYB0dh4PFb8bLVkYWYsHnfqyUFm91Sqe7NdqrbUl7Or4E5iM5INKwa wq0nFst2xuluK2I1oPxE3bJrgT3Vncrr+a73BK8k95TdWt25C7QxGeI7g P5L/Y2YaPJiuKqpy4IU3NH1szjTrbZockmKIbLC7yQT6RQ5mXKjOVfQ5S oXThmP6y/FQyShtQJ+AZUnVBkt0cxtNIM1eKEMoqA4mEHN+2uIJ03yRmb g==; X-CSE-ConnectionGUID: HgVOSWSLRqOy0uRI6OYtXQ== X-CSE-MsgGUID: m/YINrzCRvmldf2VQKD+5g== X-IronPort-AV: E=McAfee;i="6700,10204,11235"; a="54802822" X-IronPort-AV: E=Sophos;i="6.11,229,1725346800"; d="scan'208";a="54802822" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2024 06:04:32 -0700 X-CSE-ConnectionGUID: g/I8CVPbTnuHkQEMvsh7Kg== X-CSE-MsgGUID: hyUyQ+kmTH271EKuRYsdkw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,229,1725346800"; d="scan'208";a="80238788" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa007.fm.intel.com with ESMTP; 24 Oct 2024 06:04:29 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0DB7A5B8; Thu, 24 Oct 2024 16:04:25 +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 v2 07/13] iio: accel: mma9553: Replace custom implementation of iio_get_acpi_device_name() Date: Thu, 24 Oct 2024 15:36:12 +0300 Message-ID: <20241024130424.3818291-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241024130424.3818291-1-andriy.shevchenko@linux.intel.com> References: <20241024130424.3818291-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/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