From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 9B67D2FB2 for ; Wed, 26 May 2021 12:43:13 +0000 (UTC) IronPort-SDR: CO47aAmbzWgGQxsA/3Lb8/qoMxSxHY4gUiReSNcSf4D3XxyuR4BV3hmzJ5HsEPdNeseAGjxPay BnpAFZ8tzvUg== X-IronPort-AV: E=McAfee;i="6200,9189,9995"; a="266347857" X-IronPort-AV: E=Sophos;i="5.82,331,1613462400"; d="scan'208";a="266347857" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2021 05:43:11 -0700 IronPort-SDR: US5eylIamLHu1xhHFH1BUCVEeg3n3s7XnfpZPb1txTaFuAuaAmWN3z6P/0T0fvBFBVk2KpKAut iQTgivWSMM/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,331,1613462400"; d="scan'208";a="476924265" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 26 May 2021 05:43:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 485CAD7; Wed, 26 May 2021 15:43:30 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Wolfram Sang , Hans de Goede , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: Mika Westerberg , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman Subject: [PATCH v1 2/6] staging: atomisp: Replace open-coded i2c_acpi_find_client_by_adev() Date: Wed, 26 May 2021 15:43:18 +0300 Message-Id: <20210526124322.48915-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210526124322.48915-1-andriy.shevchenko@linux.intel.com> References: <20210526124322.48915-1-andriy.shevchenko@linux.intel.com> X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit gmin_i2c_dev_exists() is using open-coded variant of i2c_acpi_find_client_by_adev(). Replace it with a corresponding call. Signed-off-by: Andy Shevchenko --- .../staging/media/atomisp/pci/atomisp_gmin_platform.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index 135994d44802..a1064d1a3d6b 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -378,19 +378,14 @@ static struct i2c_client *gmin_i2c_dev_exists(struct device *dev, char *name, struct i2c_client **client) { struct acpi_device *adev; - struct device *d; adev = acpi_dev_get_first_match_dev(name, NULL, -1); if (!adev) return NULL; - d = bus_find_device_by_acpi_dev(&i2c_bus_type, adev); - acpi_dev_put(adev); - if (!d) - return NULL; + *client = i2c_acpi_find_client_by_adev(adev); - *client = i2c_verify_client(d); - put_device(d); + acpi_dev_put(adev); dev_dbg(dev, "found '%s' at address 0x%02x, adapter %d\n", (*client)->name, (*client)->addr, (*client)->adapter->nr); -- 2.30.2