Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp912801ybv; Thu, 20 Feb 2020 09:27:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxKYpF28lJCSNcAJJ9Tm56U0Kyngc+bqgJRrns+1Ngh3WdVp+1nHQazjIpOtaXOMmOIADqZ X-Received: by 2002:a05:6830:1607:: with SMTP id g7mr24299873otr.320.1582219643414; Thu, 20 Feb 2020 09:27:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582219643; cv=none; d=google.com; s=arc-20160816; b=AfyXIGxlWAvSGijvr0XJ34WrW0Fq3yhxdGyPWlVayJyvOSWKFP/DVhCun4E1Z19fAX CHOypzKK3oQFAFOQM0rZA+CoCjimi4jSGW1pErvWnnkj3cg/r5rNnF6AL2eh4D/UeRnr Q/JvhhQ7IQYZBcsM8hqs05pSP+8UjhW/1bveKGVFHlI4zSOpVBhuqgueUSMM5Tt+JDlZ ZsznYKhfjbgWIAkYhuoLwNUuCQObfd3GsX8vt5yPxZBy435bv6MJkNNJUJO4UTTUpxEb mMMxWkYs6oDWhabjlELaAtU2lNvAkPVBmLcwpYWWGOlvmLAQ1OPnfphCzrbC9PBKQpNO J+XQ== 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=GwebiARo4axxFPOLvK3zy0l1lE7U2xZhfta5/n3zsf0=; b=M4w9/XZIzqMzdNhgoR31hejNUzCtZ/Yz2dze2oA+Xhd7uCCFRByxtntBJnmHU6hiTw zf+rNaer7pFNA2NjMcZTe41+PslIZFvMSjoprdQSDvk6z9ecwPQwhsSwGEu4QQgy3mqY Qwqnvjj7ib3DR9tw+4aLVLIDwe6TT8nyhY1SpCpnP7Yjvd0gt55kDh32opyJUNb5ewZv DKTEKr3ueBCM4is9XbUTQZrqgIUAOlpl9e0VyOXZJdEtcbZAgfif/xVgGYl54QnY1V+e gOwphVbdhITf+dH6TWwZ7/uMVi5+gQYTGG/Fdra5zpc1bbP5B3kb+fruvvUFzxDMJQbq Xxww== 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 d26si38159otc.6.2020.02.20.09.27.11; Thu, 20 Feb 2020 09:27:23 -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 S1728989AbgBTR02 (ORCPT + 99 others); Thu, 20 Feb 2020 12:26:28 -0500 Received: from sauhun.de ([88.99.104.3]:35070 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728730AbgBTRZy (ORCPT ); Thu, 20 Feb 2020 12:25:54 -0500 Received: from localhost (p5486CC48.dip0.t-ipconnect.de [84.134.204.72]) by pokefinder.org (Postfix) with ESMTPSA id 80B0D2C1EBB; Thu, 20 Feb 2020 18:25:51 +0100 (CET) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-i3c@lists.infradead.org, Kieran Bingham , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Luca Ceresoli , Jacopo Mondi , Laurent Pinchart , Vladimir Zapolskiy , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Wolfram Sang Subject: [RFC PATCH 2/7] i2c: use DEFINE for the dummy driver name Date: Thu, 20 Feb 2020 18:23:58 +0100 Message-Id: <20200220172403.26062-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200220172403.26062-1-wsa+renesas@sang-engineering.com> References: <20200220172403.26062-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 We use it in multiple places, so make sure it is consistent whenever we need to change it. Signed-off-by: Wolfram Sang --- drivers/i2c/i2c-core-base.c | 8 ++++---- drivers/i2c/i2c-core.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 8f46d1bb8c62..8df2fa10c48a 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -853,7 +853,7 @@ EXPORT_SYMBOL_GPL(i2c_unregister_device); static const struct i2c_device_id dummy_id[] = { - { "dummy", 0 }, + { I2C_DUMMY_DRV_NAME, 0 }, { }, }; @@ -869,7 +869,7 @@ static int dummy_remove(struct i2c_client *client) } static struct i2c_driver dummy_driver = { - .driver.name = "dummy", + .driver.name = I2C_DUMMY_DRV_NAME, .probe = dummy_probe, .remove = dummy_remove, .id_table = dummy_id, @@ -896,7 +896,7 @@ static struct i2c_driver dummy_driver = { struct i2c_client *i2c_new_dummy_device(struct i2c_adapter *adapter, u16 address) { struct i2c_board_info info = { - I2C_BOARD_INFO("dummy", address), + I2C_BOARD_INFO(I2C_DUMMY_DRV_NAME, address), }; return i2c_new_client_device(adapter, &info); @@ -1487,7 +1487,7 @@ static void i2c_do_del_adapter(struct i2c_driver *driver, static int __unregister_client(struct device *dev, void *dummy) { struct i2c_client *client = i2c_verify_client(dev); - if (client && strcmp(client->name, "dummy")) + if (client && strcmp(client->name, I2C_DUMMY_DRV_NAME)) i2c_unregister_device(client); return 0; } diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h index 517d98be68d2..fb89fabf84d3 100644 --- a/drivers/i2c/i2c-core.h +++ b/drivers/i2c/i2c-core.h @@ -22,6 +22,8 @@ int i2c_check_7bit_addr_validity_strict(unsigned short addr); int i2c_dev_irq_from_resources(const struct resource *resources, unsigned int num_resources); +#define I2C_DUMMY_DRV_NAME "dummy" + /* * We only allow atomic transfers for very late communication, e.g. to send * the powerdown command to a PMIC. Atomic transfers are a corner case and not -- 2.20.1