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: 1173510 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46nptP2FZMz9sP7 for ; Wed, 9 Oct 2019 07:32:13 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730787AbfJHUcI (ORCPT ); Tue, 8 Oct 2019 16:32:08 -0400 Received: from sauhun.de ([88.99.104.3]:52956 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730888AbfJHUcI (ORCPT ); Tue, 8 Oct 2019 16:32:08 -0400 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 Cc: linux-i2c@vger.kernel.org, Wolfram Sang , Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.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 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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;