From patchwork Wed Nov 6 21:21:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 59897 X-Patchwork-Delegate: sean@mess.org Received: from vger.kernel.org ([209.132.180.67]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSSkB-0004wP-Vg; Wed, 06 Nov 2019 21:21:36 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732709AbfKFVVd (ORCPT + 1 other); Wed, 6 Nov 2019 16:21:33 -0500 Received: from sauhun.de ([88.99.104.3]:59102 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732688AbfKFVVc (ORCPT ); Wed, 6 Nov 2019 16:21:32 -0500 Received: from localhost (p54B33505.dip0.t-ipconnect.de [84.179.53.5]) by pokefinder.org (Postfix) with ESMTPSA id E0CB52C0553; Wed, 6 Nov 2019 22:21:30 +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 17/17] media: v4l2-core: v4l2-i2c: convert to use i2c_new_client_device() Date: Wed, 6 Nov 2019 22:21:17 +0100 Message-Id: <20191106212120.27983-18-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 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Use the new helper to bail out. It is more readable and in preparation for another conversion. Signed-off-by: Wolfram Sang --- drivers/media/v4l2-core/v4l2-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-i2c.c b/drivers/media/v4l2-core/v4l2-i2c.c index 5bf99e7c0c09..d85f5b1f5509 100644 --- a/drivers/media/v4l2-core/v4l2-i2c.c +++ b/drivers/media/v4l2-core/v4l2-i2c.c @@ -88,7 +88,7 @@ struct v4l2_subdev * want to use the i2c device, so explicitly loading the module * is the best alternative. */ - if (!client || !client->dev.driver) + if (!i2c_client_has_driver(client)) goto error; /* Lock the module so we can safely get the v4l2_subdev pointer */