Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4328823ybx; Sat, 9 Nov 2019 13:28:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwsE1MoNjq+TlZWuYEr90/KBpiQogrDOyVVi91Ayqsx2G0plJKSICzwQDn4T1lghtE/hmaH X-Received: by 2002:a17:906:edd5:: with SMTP id sb21mr12492695ejb.138.1573334912888; Sat, 09 Nov 2019 13:28:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573334912; cv=none; d=google.com; s=arc-20160816; b=I1Xuhlws7Q07YJkZfsfVt8PYFjZvijW6WKdkI2ptQ4v8qITQ20q+6Ju+ZHzpybgnqN rtCiLKITi/ocfIYYjUB71OtxpsExdM03e4b8qxfdHOtTo567U2JlgHVuQPoHqIBTSLrM GUE88g1uYKf8Mic5WI5r798nu8LEig517MDn7BG45yFVWxAQgbPvtM2AsDVaCuEARa53 tuvp+8Wo4Iw8mBkwF2chCV2dxlNuiMqh9PGcQnyUTnWvBfKJt83qoBbwmwvfXRF6abHn 4WeSp6UE17cI1W3421yf45fvqCJtJIDZOxq81dxyFW9r6JTquHieSb9CbIv8lCU35pi3 dEaA== 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=3DJKMYEQgbbdLXnZ0AsNITrNNvLehb/aMBh01WpmsM0=; b=wpnUVk1LoepSw9acVpLsU+af4UZU1JLmDmHslveKC6vWG8DQ+C0w4ncMznlbnQAhAg CYp97oq0wHNEC1V75xBx4/gEblxGREBgfCXD2Rp/40SI32NQRugDldVyq+qIM6oHI+OP ei6IqsNApzmXJBnkVAw7KIS1jNGj00ZpH84Qy89hiSWNACl3Q0w5uMpRgKABVwUxuDW1 TyhPcTN502mVvNSEMZmnzUxkY8+mwKPZY/Ljy2ZKbWc4jO5YU1fMtCG1FtQJjv4EWWo1 FV2+Zu1svihUOhncvIMbJwwrCQl8zfY+KGNw8oKhFCwnNE5nT1eUHGFym3l6iaQwix49 7qBA== 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 p17si6702387ejb.9.2019.11.09.13.27.38; Sat, 09 Nov 2019 13:28:32 -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 S1726565AbfKIV0d (ORCPT + 99 others); Sat, 9 Nov 2019 16:26:33 -0500 Received: from sauhun.de ([88.99.104.3]:47938 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbfKIV0c (ORCPT ); Sat, 9 Nov 2019 16:26:32 -0500 Received: from localhost (p54B337EF.dip0.t-ipconnect.de [84.179.55.239]) by pokefinder.org (Postfix) with ESMTPSA id C8F952C04F2; Sat, 9 Nov 2019 22:26:28 +0100 (CET) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jean Delvare , linux-renesas-soc@vger.kernel.org, Wolfram Sang Subject: [PATCH] i2c: remove helpers for ref-counting clients Date: Sat, 9 Nov 2019 22:26:15 +0100 Message-Id: <20191109212615.9254-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 There are no in-tree users of these helpers anymore, and there shouldn't. Most use cases went away once the driver model started to refcount for us. There have been users like the media subsystem, but they all switched to better refcounting methods meanwhile. Media did this in 2008. Last user (IPMI) left 2018. Remove this cruft. Signed-off-by: Wolfram Sang --- drivers/i2c/i2c-core-base.c | 32 -------------------------------- include/linux/i2c.h | 3 --- 2 files changed, 35 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 9c55d24c7a30..5a44a92ed1fb 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1743,38 +1743,6 @@ EXPORT_SYMBOL(i2c_del_driver); /* ------------------------------------------------------------------------- */ -/** - * i2c_use_client - increments the reference count of the i2c client structure - * @client: the client being referenced - * - * Each live reference to a client should be refcounted. The driver model does - * that automatically as part of driver binding, so that most drivers don't - * need to do this explicitly: they hold a reference until they're unbound - * from the device. - * - * A pointer to the client with the incremented reference counter is returned. - */ -struct i2c_client *i2c_use_client(struct i2c_client *client) -{ - if (client && get_device(&client->dev)) - return client; - return NULL; -} -EXPORT_SYMBOL(i2c_use_client); - -/** - * i2c_release_client - release a use of the i2c client structure - * @client: the client being no longer referenced - * - * Must be called when a user of a client is finished with it. - */ -void i2c_release_client(struct i2c_client *client) -{ - if (client) - put_device(&client->dev); -} -EXPORT_SYMBOL(i2c_release_client); - struct i2c_cmd_arg { unsigned cmd; void *arg; diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 8f512b992acd..23583f76c6dc 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -861,9 +861,6 @@ static inline bool i2c_client_has_driver(struct i2c_client *client) return !IS_ERR_OR_NULL(client) && client->dev.driver; } -extern struct i2c_client *i2c_use_client(struct i2c_client *client); -extern void i2c_release_client(struct i2c_client *client); - /* call the i2c_client->command() of all attached clients with * the given arguments */ extern void i2c_clients_command(struct i2c_adapter *adap, -- 2.20.1