Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp501730ybl; Tue, 7 Jan 2020 09:49:35 -0800 (PST) X-Google-Smtp-Source: APXvYqxpNgfuJnuA+G/qMDo/FDMettj4Ji/Dzzu2g6IwAKRxFgRTfFC0oC+X7ZgV2+MXsshAPKsW X-Received: by 2002:a9d:3cf:: with SMTP id f73mr988981otf.11.1578419375884; Tue, 07 Jan 2020 09:49:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578419375; cv=none; d=google.com; s=arc-20160816; b=o+a+qH12pYSIVqka1Rvz9kgP4wacAUfVKeKXo47/OPxtR+l7CZ/P9YI7Un3cxRY0IB enNhepHs4kBhUIaz3FgoxCYiD1jiz3xohnpc5yvzvxd9RK6UvIMTH7ZsvVF8XPOJJn9o K0vv+koL9l+uAuEUT7NYCdKEtvnxhGCdwKneApH9fQ7Vo2tH0QhG7KQrxv+/orn7izQa vf5bYe0Bsov38iWKbq/oqf/wBSArvK4joi0aTzl2a6g+9gm0qcV6SPi3VIBGUpCzQJsM BQ9EJVfynrUzbh2i5Bni75WveA+nToukiVdv39M7szkBrpbF/giaqeBL46nSbZd7sZ8b CIbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=gTl7oO0VHb0G7/V2ndeGMnYM3mXbuM3MDmztCC9Kf/U=; b=LroTS6Jr/+9SB5ond3unzvS4+dTDtrkdbiTZNddovFLlBjwmxKM2eutl4sqbh2HZgj zQDb5m0jTiWFtZXTy/xE30EP51BsF8nO0tXgpogsrHEcoZRORU1OOLzZ55sdtR6pqUtQ fJtNA76qbSn8rcuzhorTW6bX/NBkSVuyOmhk2dZplRG8xeJvF+RyXYVuWusoFDI4XXEC OJP4sdbg38XTskt/+/sxF5d8EHl3Uki7vEbHsBhX6uEF5pflZG9YFeDAs0eI8xON+GUT saXCxYyoOT+EKYmXKPby2JwY4eLaLikTvknnZa2uO8b5iJgGXGGDUvnF4crJ6nN+bcMm Ffyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si330887ois.76.2020.01.07.09.49.23; Tue, 07 Jan 2020 09:49:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728620AbgAGRsZ (ORCPT + 99 others); Tue, 7 Jan 2020 12:48:25 -0500 Received: from sauhun.de ([88.99.104.3]:53380 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728562AbgAGRsV (ORCPT ); Tue, 7 Jan 2020 12:48:21 -0500 Received: from localhost (p5486CF8B.dip0.t-ipconnect.de [84.134.207.139]) by pokefinder.org (Postfix) with ESMTPSA id E5A752C3946; Tue, 7 Jan 2020 18:48:19 +0100 (CET) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Mika Westerberg , Wolfram Sang , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/12] i2c: i2c-core-acpi: convert to use i2c_new_client_device() Date: Tue, 7 Jan 2020 18:47:42 +0100 Message-Id: <20200107174748.9616-9-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200107174748.9616-1-wsa+renesas@sang-engineering.com> References: <20200107174748.9616-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang --- Build tested only. drivers/i2c/i2c-core-acpi.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c index 62a1c92ab803..8f3dbc97a057 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c @@ -225,7 +225,7 @@ static void i2c_acpi_register_device(struct i2c_adapter *adapter, adev->power.flags.ignore_parent = true; acpi_device_set_enumerated(adev); - if (!i2c_new_device(adapter, info)) { + if (IS_ERR(i2c_new_client_device(adapter, info))) { adev->power.flags.ignore_parent = false; dev_err(&adapter->dev, "failed to add I2C device %s from ACPI\n", @@ -451,7 +451,8 @@ struct notifier_block i2c_acpi_notifier = { * resources, in that case this function can be used to create an i2c-client * for other I2cSerialBus resources in the Current Resource Settings table. * - * Also see i2c_new_device, which this function calls to create the i2c-client. + * Also see i2c_new_client_device, which this function calls to create the + * i2c-client. * * Returns a pointer to the new i2c-client, or error pointer in case of failure. * Specifically, -EPROBE_DEFER is returned if the adapter is not found. @@ -461,7 +462,6 @@ struct i2c_client *i2c_acpi_new_device(struct device *dev, int index, { struct i2c_acpi_lookup lookup; struct i2c_adapter *adapter; - struct i2c_client *client; struct acpi_device *adev; LIST_HEAD(resource_list); int ret; @@ -489,11 +489,7 @@ struct i2c_client *i2c_acpi_new_device(struct device *dev, int index, if (!adapter) return ERR_PTR(-EPROBE_DEFER); - client = i2c_new_device(adapter, info); - if (!client) - return ERR_PTR(-ENODEV); - - return client; + return i2c_new_client_device(adapter, info); } EXPORT_SYMBOL_GPL(i2c_acpi_new_device); -- 2.20.1