Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2376723pja; Thu, 26 Mar 2020 14:13:46 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtwWwxb9fXJQXIM5cBPyGY+V9dQdaYVDidtUxF6a/MJVJapP1b/LKOUCJZm/lrqROW6GOUp X-Received: by 2002:aca:f288:: with SMTP id q130mr1751707oih.33.1585257225825; Thu, 26 Mar 2020 14:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585257225; cv=none; d=google.com; s=arc-20160816; b=pePBciIoWSbC/iBxXRBbwDuEWhWtZhJYZEVNuAF5akcl6+7Dno8FXkenjlRhiRkcVF JKKBbvwWRbESpp6lhBfRtSCjN1yMQbMXbYNCEQSZeozDwwGzDx1DfZxP3G8165CHxBJr bpAJmbVsjoTVB1bcWHvRnEy9IAVptbPqTEtnU6d9x0QhuPGSHWAWG4Dtn1VKaxxmgmMu b6wu8TfnOSSEC4zuqUYcOxS9mAmpwY5lNvfNrPCpmGk9cGm/l/3mjG/KFDkTHRNOXBqJ lQTsD64ou58plC3UTU0GdW2GW9yJJn/8cedZf1x8Gc7HokXsC+DNrZVo1kD8fMMKn5Kw Cx/Q== 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=CKqXHORIKkhs5HDFJxe53w+deAYL+6Nrqjk7CL1pQGM=; b=bVFBOI3/oTHE+vabVZ+cEJibi7QHhMcrzbLKhCGiHGpj67xfh2mj0CgL5urMWl3jtQ PnGrZSL+sQfSqDsjrsayZi/DisTiaFGtQ5MFcGeHvDdP5vI0J1D+JteUCN6R1DfdOxBs UoMFW3PTxlLokli+CiEJvEq+6OYXzjzXSdgkjBqkBkELV3vmXyzj1Bm3D0Uac8asCyAk ub9b17dDqU/NzA9HbHNxgsqVSgspjY38H6u4HuX0OEuxN9t+f1Ds/9n8mPgiBeFu1eCn zzfAmY27uZq6Jqb8WiHynrPszeGFB0O27KA5EjXhG25e4yBg+FMYkySlSPKiz7jmWwIL vXbA== 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 r24si1368121otp.264.2020.03.26.14.13.32; Thu, 26 Mar 2020 14:13:45 -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 S1727953AbgCZVMq (ORCPT + 99 others); Thu, 26 Mar 2020 17:12:46 -0400 Received: from sauhun.de ([88.99.104.3]:54276 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726330AbgCZVJv (ORCPT ); Thu, 26 Mar 2020 17:09:51 -0400 Received: from localhost (p54B3331F.dip0.t-ipconnect.de [84.179.51.31]) by pokefinder.org (Postfix) with ESMTPSA id E43FD2C1F87; Thu, 26 Mar 2020 22:09:48 +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 1/6] media: pci: cx88: convert to use i2c_new_client_device() Date: Thu, 26 Mar 2020 22:09:41 +0100 Message-Id: <20200326210947.12747-2-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/pci/cx88/cx88-core.c | 3 +-- drivers/media/pci/cx88/cx88-input.c | 2 +- drivers/media/pci/cx88/cx88-video.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/media/pci/cx88/cx88-core.c b/drivers/media/pci/cx88/cx88-core.c index dcadf78657d6..48c8a3429542 100644 --- a/drivers/media/pci/cx88/cx88-core.c +++ b/drivers/media/pci/cx88/cx88-core.c @@ -1070,8 +1070,7 @@ void cx88_core_put(struct cx88_core *core, struct pci_dev *pci) mutex_lock(&devlist); cx88_ir_fini(core); if (core->i2c_rc == 0) { - if (core->i2c_rtc) - i2c_unregister_device(core->i2c_rtc); + i2c_unregister_device(core->i2c_rtc); i2c_del_adapter(&core->i2c_adap); } list_del(&core->devlist); diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c index c7c2acd55266..7e0fed9cd200 100644 --- a/drivers/media/pci/cx88/cx88-input.c +++ b/drivers/media/pci/cx88/cx88-input.c @@ -638,7 +638,7 @@ void cx88_i2c_init_ir(struct cx88_core *core) I2C_SMBUS_READ, 0, I2C_SMBUS_QUICK, NULL) >= 0) { info.addr = *addrp; - i2c_new_device(&core->i2c_adap, &info); + i2c_new_client_device(&core->i2c_adap, &info); break; } } diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c index 6aabc45aa93c..ba0e9660a047 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c @@ -1385,7 +1385,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev, }; request_module("rtc-isl1208"); - core->i2c_rtc = i2c_new_device(&core->i2c_adap, &rtc_info); + core->i2c_rtc = i2c_new_client_device(&core->i2c_adap, &rtc_info); } /* fall-through */ case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: -- 2.20.1