Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp73208ybx; Wed, 6 Nov 2019 13:26:02 -0800 (PST) X-Google-Smtp-Source: APXvYqwpYxp2c1QYCNmdf1fInS5jAapuatyS7r7fs08je562AFaG9XWaHcE5xPP5JR5StWh/QfGD X-Received: by 2002:a50:f987:: with SMTP id q7mr5159117edn.205.1573075561936; Wed, 06 Nov 2019 13:26:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573075561; cv=none; d=google.com; s=arc-20160816; b=sGkivqZYJI2mTehtQUXmKZP57vD317sase1fp/VCMcvpwLMCi8M/hnNS/p0mRDlaoq Q4UQpPsEF3N6v6QJAgdpGPZSslsDYGFJCb94sntDB9skVxAfx45SoVWBhSlOYmCEwLDB oQCMpbKSi52BeE82L+JFW2x1/IMlwZCANG5wBws1CMa2vb4UlfmrDl9px9oZfHR3JbO8 jFr/ZZwjNIPCsjYNjbO1PFZRl5O7oo7kyoKTXfKmimUPJkvyGa8j8jbMNNBtIsGlqBrD viWbgHtnMSpv6AOfx8SyjIih2b0J9z9xU2MAJUiQeGTF7ygONFLAgZjNIiipdSsPSHhr g4uA== 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=v6HHp0hxxGhN/f3Cc6oeMbRHlGus68GFsuvcxLUxUM8=; b=JV9Z6n3dL6qCsJyss5DC0BozM4wgF7vWUnvTf8nbtKqanzUFTNZK9V+eHwRSfweKva YegV8PiBlYbT/f24EQk8vxaFsmT8iqAbs0pdUxy0HzaN/wqDV3gdhRNLycCfwzYUdELd stlbRYA8LypXKtErQWqm66zK4torbiOOhdWinDQ3pqvm1eFqlbGV8OEzIF6v0bagvuN9 7doTVBIuPSquSrDJN4w+/uR8B/H8ezEtTQIeE/LiM9tZMg/vJwWPdD0GFKeKtEJY15p6 K3tVwK74IVbh9CzLwxbh8oLs+zSw0RiaVgfnIjbrziqUyGu92TDK0rXTFRsOWy55iRoF wtqA== 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 bo7si95882ejb.15.2019.11.06.13.25.38; Wed, 06 Nov 2019 13:26:01 -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 S1732808AbfKFVWJ (ORCPT + 99 others); Wed, 6 Nov 2019 16:22:09 -0500 Received: from sauhun.de ([88.99.104.3]:59040 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732635AbfKFVV2 (ORCPT ); Wed, 6 Nov 2019 16:21:28 -0500 Received: from localhost (p54B33505.dip0.t-ipconnect.de [84.179.53.5]) by pokefinder.org (Postfix) with ESMTPSA id 3881C2C055F; Wed, 6 Nov 2019 22:21:26 +0100 (CET) From: Wolfram Sang To: linux-media@vger.kernel.org Cc: linux-i2c@vger.kernel.org, Wolfram Sang , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH 09/17] media: pci: smipcie: smipcie-main: convert to use i2c_new_client_device() Date: Wed, 6 Nov 2019 22:21:09 +0100 Message-Id: <20191106212120.27983-10-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191106212120.27983-1-wsa+renesas@sang-engineering.com> References: <20191106212120.27983-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 Use the newer API returning an ERRPTR and use the new helper to bail out. Signed-off-by: Wolfram Sang --- drivers/media/pci/smipcie/smipcie-main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/smipcie/smipcie-main.c b/drivers/media/pci/smipcie/smipcie-main.c index 1fb78462e081..9ca0fc3e6f80 100644 --- a/drivers/media/pci/smipcie/smipcie-main.c +++ b/drivers/media/pci/smipcie/smipcie-main.c @@ -484,8 +484,8 @@ static struct i2c_client *smi_add_i2c_client(struct i2c_adapter *adapter, struct i2c_client *client; request_module(info->type); - client = i2c_new_device(adapter, info); - if (client == NULL || client->dev.driver == NULL) + client = i2c_new_client_device(adapter, info); + if (!i2c_client_has_driver(client)) goto err_add_i2c_client; if (!try_module_get(client->dev.driver->owner)) { -- 2.20.1