Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp501958ybl; Tue, 7 Jan 2020 09:49:53 -0800 (PST) X-Google-Smtp-Source: APXvYqymxUVyAntG14PwL+gBiWwnBsJCJEX1lcrJZYDCfx6jdjWWlg5jNNNHACtIK2lYr3MgRiE6 X-Received: by 2002:aca:6545:: with SMTP id j5mr619871oiw.60.1578419393250; Tue, 07 Jan 2020 09:49:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578419393; cv=none; d=google.com; s=arc-20160816; b=Wo+ufB9YatAQS9jhZ/CmRGim6WRquGzDRcLqU7V+1IaPe2/ho6Cum07IzcQU9pf1SX lGtVGFAYUXIYQ6fha+nDjvupMc4xf2uktuXR+lU4oV7Mt6NRpdPwOUcj6kzUTdm474w7 mbnkaW+iHbHf8bUho23SvNPcpHOP/bHtlzZKhoUfh1Ab3XNj9zLeotw3fK1AkWwsF9mJ /+RN/e0BDWzkdIPhhOgquMhyxE10CBif6VhPNaL41kZFz3H2Bw8eLE6/O8sAH4mdQIlJ gkg9i0ufnvblCL76gQAfxVcRHnrHyUsAGs9w2hbEkxrNrpJl2/uinS2e7EORZTz/NnpQ 5o2A== 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=WosxVm+wt7E0GEYsO8KQuwIrGvYsKjxlTYR/ghNtnwc=; b=kPX0ngOCV78hgieAO6LwdufHOP/cLgV0h7+np/aS6Ov/y4kZbY57bS4ZxK2Cp5Eavk bk1PVH7STjQaK42Dw6nIeEndADnHrFQF6XsiDsXxKijFkhkTBApfSD1ZhUE7CCTk8mti vmahG9YYz29r8ozleJ3UBx9s/HKy6+B3WSurz1vA6TnRi5tqR5ZOwaC+k3VcfvAdiX62 VYOpSHuEBAgnWNi2X0jNHQ2sJ8xHvaNZkOQbCeY0IruIcpCBPcneOhcHLwFqg8zTlRma VR6uOH88LbGA+/O7edQBD9jKZxQg7ATCP2yr/GxcP/TqkA7rGRSJfbCOGyLkWtv6zbfw xt4w== 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 f187si330752oia.218.2020.01.07.09.49.40; Tue, 07 Jan 2020 09:49:53 -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 S1728654AbgAGRsi (ORCPT + 99 others); Tue, 7 Jan 2020 12:48:38 -0500 Received: from sauhun.de ([88.99.104.3]:53364 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728568AbgAGRsW (ORCPT ); Tue, 7 Jan 2020 12:48:22 -0500 Received: from localhost (p5486CF8B.dip0.t-ipconnect.de [84.134.207.139]) by pokefinder.org (Postfix) with ESMTPSA id 0FF7A2C394D; Tue, 7 Jan 2020 18:48:21 +0100 (CET) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Wolfram Sang , linux-kernel@vger.kernel.org Subject: [PATCH 10/12] i2c: i2c-core-of: convert to use i2c_new_client_device() Date: Tue, 7 Jan 2020 18:47:44 +0100 Message-Id: <20200107174748.9616-11-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-of.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c index e4d296b40baa..6787c1f71483 100644 --- a/drivers/i2c/i2c-core-of.c +++ b/drivers/i2c/i2c-core-of.c @@ -75,11 +75,10 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap, if (ret) return ERR_PTR(ret); - client = i2c_new_device(adap, &info); - if (!client) { + client = i2c_new_client_device(adap, &info); + if (IS_ERR(client)) dev_err(&adap->dev, "of_i2c: Failure registering %pOF\n", node); - return ERR_PTR(-EINVAL); - } + return client; } -- 2.20.1