Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2377269pja; Thu, 26 Mar 2020 14:14:21 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsvepInf4m66j7x4zqz+F4EyplThchRDLHUxezWgsxYMGMezkJ5545VnEW+2gE+Mi3klvlt X-Received: by 2002:aca:cdcd:: with SMTP id d196mr1822818oig.16.1585257261844; Thu, 26 Mar 2020 14:14:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585257261; cv=none; d=google.com; s=arc-20160816; b=hjGtFPVlq/Opndaukl8i8GhJEjTakmiRBgpvXJgoZjwrvh93/Wtr5Pf1lVukPFWdM2 wEqQ52ol0J1LKL5QeDiByhny5zB2/s5i1fuBlNtvTakUY7EEHhJ8W8Ng6qDLDJlja5JY zFDINvsGtCkQTsE9pGiPbm8R0f3Zm+Q9s0wwfWXL0Sv45Djh1OU9s6+PhRPcawUfs84a 3VIis/4dHciMIgzDGVSPLa0oeLlih0JYDKYS3SoZyDY1xBef4P9yhZ3Z/gUlh+F5j8HN 6l+3EfDxKxyp0rICo+2c7Ky5peHvdlRkZ8ChFhhJlmJ7HqOowsKFJLTts/obJwnVfS+M I8eA== 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=h8jLHX2mcfwaW4xHo0uYRwHii4QQstXnHRd6bDGXofg=; b=TycCcKoEruLV2xPZmzNsMMP+sZpPCy/LSgxTPSwCv39u2qx8SrXBBuArKJFvroMyHX fqBvuHQPIYs4/zPYmI+RZekm3aek3w5AW0sDBZYxRHl3x4IiqShY7m+G0fY6LJyt99Fw U4gL5Dib2puUe9y9Rx1Av+dy2bRObgsfMqqW7KbhZksgEQylx96Vo4WQ0C9YcOBdvIsE ICxUt0AWYO7y2kvll7b90NZ7pcRa0QfzqCPtyeBJzo0gOYDfytH8lr+IPSBKk1Q49ulE UkXDjcy0ds+Svr0S1onkx8zcFnyUSkRe6dVGLwbvq+fV9AZiqVOdas7fbEVvLCG+d0AS mlug== 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 d63si1520517oib.224.2020.03.26.14.14.09; Thu, 26 Mar 2020 14:14:21 -0700 (PDT) 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 S1727769AbgCZVJy (ORCPT + 99 others); Thu, 26 Mar 2020 17:09:54 -0400 Received: from sauhun.de ([88.99.104.3]:54328 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727473AbgCZVJw (ORCPT ); Thu, 26 Mar 2020 17:09:52 -0400 Received: from localhost (p54B3331F.dip0.t-ipconnect.de [84.179.51.31]) by pokefinder.org (Postfix) with ESMTPSA id 87EE82C1F8A; Thu, 26 Mar 2020 22:09:50 +0100 (CET) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] media: usb: cx231xx: convert to use i2c_new_client_device() Date: Thu, 26 Mar 2020 22:09:44 +0100 Message-Id: <20200326210947.12747-5-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200326210947.12747-1-wsa+renesas@sang-engineering.com> References: <20200326210947.12747-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 Move away from the deprecated API and make use of the fact that unregistering devices is NULL- and ERR_PTR-safe. Signed-off-by: Wolfram Sang --- drivers/media/usb/cx231xx/cx231xx-input.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-input.c b/drivers/media/usb/cx231xx/cx231xx-input.c index 9f88c640ec2b..8149702bcf89 100644 --- a/drivers/media/usb/cx231xx/cx231xx-input.c +++ b/drivers/media/usb/cx231xx/cx231xx-input.c @@ -88,7 +88,7 @@ int cx231xx_ir_init(struct cx231xx *dev) ir_i2c_bus = cx231xx_boards[dev->model].ir_i2c_master; dev_dbg(dev->dev, "Trying to bind ir at bus %d, addr 0x%02x\n", ir_i2c_bus, info.addr); - dev->ir_i2c_client = i2c_new_device( + dev->ir_i2c_client = i2c_new_client_device( cx231xx_get_i2c_adap(dev, ir_i2c_bus), &info); return 0; @@ -96,7 +96,6 @@ int cx231xx_ir_init(struct cx231xx *dev) void cx231xx_ir_exit(struct cx231xx *dev) { - if (dev->ir_i2c_client) - i2c_unregister_device(dev->ir_i2c_client); + i2c_unregister_device(dev->ir_i2c_client); dev->ir_i2c_client = NULL; } -- 2.20.1