From patchwork Mon Jul 22 17:26:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 11053963 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B9FBE912 for ; Tue, 23 Jul 2019 07:14:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A608228573 for ; Tue, 23 Jul 2019 07:14:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99EEC285D5; Tue, 23 Jul 2019 07:14:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CF91428573 for ; Tue, 23 Jul 2019 07:14:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B422E89016; Tue, 23 Jul 2019 07:14:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from pokefinder.org (sauhun.de [88.99.104.3]) by gabe.freedesktop.org (Postfix) with ESMTP id DB88B89CF5 for ; Mon, 22 Jul 2019 17:26:10 +0000 (UTC) Received: from localhost (p54B33E22.dip0.t-ipconnect.de [84.179.62.34]) by pokefinder.org (Postfix) with ESMTPSA id 275FB4A1494; Mon, 22 Jul 2019 19:26:10 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Subject: [PATCH 1/1] gpu: drm: bridge: analogix-anx78xx: convert to i2c_new_dummy_device Date: Mon, 22 Jul 2019 19:26:09 +0200 Message-Id: <20190722172609.3731-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190722172609.3731-1-wsa+renesas@sang-engineering.com> References: <20190722172609.3731-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 23 Jul 2019 07:14:10 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Wolfram Sang , Laurent Pinchart Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an ERRPTR which we use in error handling. Signed-off-by: Wolfram Sang --- Generated with coccinelle. Build tested by me and buildbot. Not tested on HW. drivers/gpu/drm/bridge/analogix-anx78xx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c index 3c7cc5af735c..be7756280e41 100644 --- a/drivers/gpu/drm/bridge/analogix-anx78xx.c +++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c @@ -1350,10 +1350,10 @@ static int anx78xx_i2c_probe(struct i2c_client *client, /* Map slave addresses of ANX7814 */ for (i = 0; i < I2C_NUM_ADDRESSES; i++) { - anx78xx->i2c_dummy[i] = i2c_new_dummy(client->adapter, + anx78xx->i2c_dummy[i] = i2c_new_dummy_device(client->adapter, anx78xx_i2c_addresses[i] >> 1); - if (!anx78xx->i2c_dummy[i]) { - err = -ENOMEM; + if (IS_ERR(anx78xx->i2c_dummy[i])) { + err = PTR_ERR(anx78xx->i2c_dummy[i]); DRM_ERROR("Failed to reserve I2C bus %02x\n", anx78xx_i2c_addresses[i]); goto err_unregister_i2c;