Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp71730ybx; Wed, 6 Nov 2019 13:24:33 -0800 (PST) X-Google-Smtp-Source: APXvYqx7nNCynsQTgVyj8i/XYKG39sRs08CG/gniFyRf3MXJzilv3E43GrvcrDwHeX3cLrHHCya8 X-Received: by 2002:a17:906:49cd:: with SMTP id w13mr34756888ejv.311.1573075473041; Wed, 06 Nov 2019 13:24:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573075473; cv=none; d=google.com; s=arc-20160816; b=RCuTwMvFXDxOxgf1+VYO5lEHJcpMieiBLCaLPLQJob3q3fd3y9O98cbvDs3tq1XEvy VOax0YTnjtPmivVRZnb6teSkQ8zhco2f3j91pSGtcu5pL5eyXnQc6bZdcxODpFhfMisX E1TeUNNI+TxVSW3RVEh7z5W7b8jCUYYYCdmqQHucAtSxvpyOUOy4jochpiOmfoHWPtiI F7AiDRVn40+2ZfKWJUYamzyYdIgU1qV/tRTM6eZR20G125RIPNxVvWFn6+ehiTWODLbj j38xynunFJV78s13Mp1NWiWNfIpnVpIT9U8Gy3q3Dw6uA8DugIwSghuMakxEYXMKU+Zq 4Nvg== 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 :message-id:date:subject:cc:to:from; bh=6bXy4vrXTwLHGitlbxFV0VUs9lxodjfJWucgzMGno7o=; b=gLi6ii9LQ6RnlfFEBfUv0D1tbsCrGGJbYv8lrMrH/bd+Eq7G7CJTvG8qYh35f/uY7M rDGEQ2v2FgxMlJC9TkyztHT08hx3PmT288l7mmCmZ4XzNU7KAA4suh5qQKzJeMoxH3Ft I0dvwI498Wfi8H8Sxzk34/YdabsokOfRItOguX2AFsyg2fxpwy4H346dp5WkZmn6sDQS Fy5Cyhor9yg+pTRXYppq97SyPd/TBR+GUxBfuPtmdiBeMUvtLHGmzvKOQFub8xFaH+0T h7x3mv3onTlRsIEX6RQOodrYfNT+CWF7Ic7WPmQSlSKDK8jxsixwSSw3dk1f1QOza1UE T9Ig== 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 fi6si65726ejb.430.2019.11.06.13.24.08; Wed, 06 Nov 2019 13:24:33 -0800 (PST) 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 S1732292AbfKFVVX (ORCPT + 99 others); Wed, 6 Nov 2019 16:21:23 -0500 Received: from sauhun.de ([88.99.104.3]:58966 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727921AbfKFVVX (ORCPT ); Wed, 6 Nov 2019 16:21:23 -0500 Received: from localhost (p54B33505.dip0.t-ipconnect.de [84.179.53.5]) by pokefinder.org (Postfix) with ESMTPSA id 732742C053B; Wed, 6 Nov 2019 22:21:20 +0100 (CET) From: Wolfram Sang To: linux-media@vger.kernel.org Cc: linux-i2c@vger.kernel.org, Wolfram Sang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 00/17] media: use new API for creating client devices Date: Wed, 6 Nov 2019 22:21:00 +0100 Message-Id: <20191106212120.27983-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 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 These media drivers create a new I2C client device with the deprecated i2c_new_device() and check afterwards if the client exists and if a driver is bound to it. These series changes the drivers to use the now suggested i2c_new_client_device() call and introduces a helper to check if the driver is bound. This helper supports (for now) the old and the new API and is also more readable. The drivers were converted with the following coccinelle script: @@ expression client; statement S; @@ client = - i2c_new_device + i2c_new_client_device (...); ... when != client if ( - \( !client \| client == NULL \) || \( !client->dev.driver \| client->dev.driver == NULL \) + !i2c_client_has_driver(client) ) { S } The helper has been tested on a Renesas Salvator-XS board (R-Car M3-N). The rest was build tested by me. buildbot has this still queued. Although the first patch is in the I2C realm, I suggest that all patches go through the media tree to avoid the dependency. There are no merge conflicts with I2C currently and I don't see any coming (famous last words). This series is based on linux-next as of today. It does not depend on the i2c_new_probed_device() conversion I sent out earlier today. This series can be applied as is. Looking forward to comments. Thanks and happy hacking, Wolfram Wolfram Sang (17): i2c: add helper to check if a client has a driver attached media: dvb-core: dvbdev: convert to use i2c_new_client_device() media: dvb-frontends: cxd2820r_core: convert to use i2c_new_client_device() media: dvb-frontends: lgdt330x: convert to use i2c_new_client_device() media: dvb-frontends: m88ds3103: convert to use i2c_new_client_device() media: dvb-frontends: ts2020: convert to use i2c_new_client_device() media: pci: cx23885: cx23885-dvb: convert to use i2c_new_client_device() media: pci: saa7164: saa7164-dvb: convert to use i2c_new_client_device() media: pci: smipcie: smipcie-main: convert to use i2c_new_client_device() media: platform: sti: c8sectpfe: c8sectpfe-dvb: convert to use i2c_new_client_device() media: usb: dvb-usb-v2: af9035: convert to use i2c_new_client_device() media: usb: dvb-usb-v2: anysee: convert to use i2c_new_client_device() media: usb: dvb-usb-v2: rtl28xxu: convert to use i2c_new_client_device() media: usb: dvb-usb-v2: zd1301: convert to use i2c_new_client_device() media: usb: dvb-usb: dib0700_devices: convert to use i2c_new_client_device() media: usb: dvb-usb: dw2102: convert to use i2c_new_client_device() media: v4l2-core: v4l2-i2c: convert to use i2c_new_client_device() drivers/media/dvb-core/dvbdev.c | 4 +- drivers/media/dvb-frontends/cxd2820r_core.c | 4 +- drivers/media/dvb-frontends/lgdt330x.c | 4 +- drivers/media/dvb-frontends/m88ds3103.c | 4 +- drivers/media/dvb-frontends/ts2020.c | 4 +- drivers/media/pci/cx23885/cx23885-dvb.c | 114 +++++++++--------- drivers/media/pci/saa7164/saa7164-dvb.c | 20 +-- drivers/media/pci/smipcie/smipcie-main.c | 4 +- .../platform/sti/c8sectpfe/c8sectpfe-dvb.c | 4 +- drivers/media/usb/dvb-usb-v2/af9035.c | 4 +- drivers/media/usb/dvb-usb-v2/anysee.c | 4 +- drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 36 +++--- drivers/media/usb/dvb-usb-v2/zd1301.c | 4 +- drivers/media/usb/dvb-usb/dib0700_devices.c | 8 +- drivers/media/usb/dvb-usb/dw2102.c | 8 +- drivers/media/v4l2-core/v4l2-i2c.c | 2 +- include/linux/i2c.h | 5 + 17 files changed, 116 insertions(+), 117 deletions(-) -- 2.20.1