From patchwork Tue Oct 8 20:31:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 11180601 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C986414ED for ; Wed, 9 Oct 2019 07:13:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 570A420B7C for ; Wed, 9 Oct 2019 07:13:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 570A420B7C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B9FCF6E908; Wed, 9 Oct 2019 07:13:05 +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 B9C8D6E89D for ; Tue, 8 Oct 2019 20:40:18 +0000 (UTC) Received: from localhost (p54B3324A.dip0.t-ipconnect.de [84.179.50.74]) by pokefinder.org (Postfix) with ESMTPSA id 2620B2C07B8; Tue, 8 Oct 2019 22:32:06 +0200 (CEST) From: Wolfram Sang To: dri-devel@lists.freedesktop.org Subject: [PATCH RESEND] gpu: drm: bridge: analogix-anx78xx: convert to i2c_new_dummy_device Date: Tue, 8 Oct 2019 22:31:45 +0200 Message-Id: <20191008203145.3159-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 09 Oct 2019 07:12:51 +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: Jernej Skrabec , Jonas Karlman , David Airlie , Neil Armstrong , linux-kernel@vger.kernel.org, Wolfram Sang , Laurent Pinchart , linux-i2c@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Move from the deprecated i2c_new_dummy() to i2c_new_dummy_device(). We now get an ERRPTR which we use in error handling. Signed-off-by: Wolfram Sang Reviewed-by: Laurent Pinchart --- Rebased to v5.4-rc2 since last time. One of the last two users of the old API, so please apply soon, so I can remove the old interface. Only build tested. 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;