From patchwork Wed May 26 12:43:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 449169 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BC4CC47088 for ; Wed, 26 May 2021 12:43:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7587C613E6 for ; Wed, 26 May 2021 12:43:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234776AbhEZMpZ (ORCPT ); Wed, 26 May 2021 08:45:25 -0400 Received: from mga09.intel.com ([134.134.136.24]:35379 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234729AbhEZMoy (ORCPT ); Wed, 26 May 2021 08:44:54 -0400 IronPort-SDR: 7SNAp/d/nkUtNy+9vbWRKLq96AOnme3lPrB6me9KeKgPl++fohvU0Dc53I+j+KPnkjV16wnYCa 3mvTLcSNuUiw== X-IronPort-AV: E=McAfee;i="6200,9189,9995"; a="202465789" X-IronPort-AV: E=Sophos;i="5.82,331,1613462400"; d="scan'208";a="202465789" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.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> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Reviewed-by: Mauro Carvalho Chehab --- .../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);