From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x226FsM2GKxTvo9Zz0BS07a+Enmx68jWwfkaGA7sJR9CwQP5qIjpRauuK7OIamitYCY3fjAy2 ARC-Seal: i=1; a=rsa-sha256; t=1516732697; cv=none; d=google.com; s=arc-20160816; b=v2c9dZ1y8FprQcptVswWjcf21rtpcOK4G35f6JxQc9TH6ksCXeQZ9BvPKKFfM+4plt OgZ2vg+C3hzgyxJOazz8+cvtv4mSlSbFXpG7c/6G+IRC8PV/h5Hqx4fhw5TOtReTK7Yd L1F/++CqdpHlPRIV7GIFwka5MHm8aJKa/UwlAGK0c8Nx/QFzXPe0ScsAtm9SQBagNNHS tQPpQm5Of7a7R5sqFnr/UMGaMUyyb258KJBsdMB+pDEzJXmyC+Q0+9tCvOACi9M5PHdu SAr6Sc8vhPBOnOQX0f8tcKMAXP+RGie49XK+ICYxWq8MEHK6A8omhg+C5kjcvv2zU1As Pjhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=nLJaOAVW51mOiPFgrk6Ot0WlkepnG6y97bF4nRV8SYU=; b=T2YiFMYd89eYQJE6tK82Q8SKBa7LTZ1OkFFRcpuvaEsYvpX2aANzTLqG9EkrQtAfgg iVEA+QIYVAXP6Wgu3ib0DmIODxo4qxGTfWu9Ox2B6uFO6nn3ZLVsJE3LMn/lJwJf6PUn ebJY9icHVdG3ukAz7kVWO5fSwznJstojqoIv2+HxKhbfxqgNCIS2RpbjOrTS4Wf/Y5dn 1PyTeKdCJiLg7oFGwk3PAn7kIjBP4Obn84Yu6rh7TWti/fAlZ89RULU6hV4ws2HqoCiZ 13oyzTgKoS/xSVsAYP3oty78ALMuKid96HiMNY0Yyce41H4kQex00SeHw4V9bmAbUSUL RQXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of vadimp@mellanox.com designates 193.47.165.129 as permitted sender) smtp.mailfrom=vadimp@mellanox.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of vadimp@mellanox.com designates 193.47.165.129 as permitted sender) smtp.mailfrom=vadimp@mellanox.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com From: Vadim Pasternak To: dvhart@infradead.org, andy.shevchenko@gmail.com, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, jiri@resnulli.us, Vadim Pasternak Subject: [patch v10 3/6] platform/mellanox: Rename i2c bus to nr Date: Tue, 23 Jan 2018 20:34:22 +0000 Message-Id: <1516739665-132304-3-git-send-email-vadimp@mellanox.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1516739665-132304-1-git-send-email-vadimp@mellanox.com> References: <1516739665-132304-1-git-send-email-vadimp@mellanox.com> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590409504278870279?= X-GMAIL-MSGID: =?utf-8?q?1590409504278870279?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: Use Linux convention of nr instead of bus for i2c adapter number. Signed-off-by: Vadim Pasternak Acked-by: Andy Shevchenko --- v9->v10: Fixes provideded by Darren: - refactore commit into smaller functional changes; --- drivers/platform/mellanox/mlxreg-hotplug.c | 6 +++--- drivers/platform/x86/mlx-platform.c | 16 ++++++++-------- include/linux/platform_data/mlxreg.h | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c index 1a04cb2..5f0b4ff 100644 --- a/drivers/platform/mellanox/mlxreg-hotplug.c +++ b/drivers/platform/mellanox/mlxreg-hotplug.c @@ -101,17 +101,17 @@ struct mlxreg_hotplug_priv_data { static int mlxreg_hotplug_device_create(struct device *dev, struct mlxreg_hotplug_device *item) { - item->adapter = i2c_get_adapter(item->bus); + item->adapter = i2c_get_adapter(item->nr); if (!item->adapter) { dev_err(dev, "Failed to get adapter for bus %d\n", - item->bus); + item->nr); return -EFAULT; } item->client = i2c_new_device(item->adapter, &item->brdinfo); if (!item->client) { dev_err(dev, "Failed to create client %s at bus %d at addr 0x%02x\n", - item->brdinfo.type, item->bus, item->brdinfo.addr); + item->brdinfo.type, item->nr, item->brdinfo.addr); i2c_put_adapter(item->adapter); item->adapter = NULL; return -EFAULT; diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 0fbec1f..5601714 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -141,41 +141,41 @@ static struct i2c_mux_reg_platform_data mlxplat_mux_data[] = { static struct mlxreg_hotplug_device mlxplat_mlxcpld_psu[] = { { .brdinfo = { I2C_BOARD_INFO("24c02", 0x51) }, - .bus = 10, + .nr = 10, }, { .brdinfo = { I2C_BOARD_INFO("24c02", 0x50) }, - .bus = 10, + .nr = 10, }, }; static struct mlxreg_hotplug_device mlxplat_mlxcpld_pwr[] = { { .brdinfo = { I2C_BOARD_INFO("dps460", 0x59) }, - .bus = 10, + .nr = 10, }, { .brdinfo = { I2C_BOARD_INFO("dps460", 0x58) }, - .bus = 10, + .nr = 10, }, }; static struct mlxreg_hotplug_device mlxplat_mlxcpld_fan[] = { { .brdinfo = { I2C_BOARD_INFO("24c32", 0x50) }, - .bus = 11, + .nr = 11, }, { .brdinfo = { I2C_BOARD_INFO("24c32", 0x50) }, - .bus = 12, + .nr = 12, }, { .brdinfo = { I2C_BOARD_INFO("24c32", 0x50) }, - .bus = 13, + .nr = 13, }, { .brdinfo = { I2C_BOARD_INFO("24c32", 0x50) }, - .bus = 14, + .nr = 14, }, }; diff --git a/include/linux/platform_data/mlxreg.h b/include/linux/platform_data/mlxreg.h index 8dcbb8e..ffbcb78 100644 --- a/include/linux/platform_data/mlxreg.h +++ b/include/linux/platform_data/mlxreg.h @@ -39,7 +39,7 @@ * @adapter: I2C device adapter; * @client: I2C device client; * @brdinfo: device board information; - * @bus: I2C bus, where device is attached; + * @nr: I2C device adapter number, to which device is to be attached; * * Structure represents I2C hotplug device static data (board topology) and * dynamic data (related kernel objects handles). @@ -48,7 +48,7 @@ struct mlxreg_hotplug_device { struct i2c_adapter *adapter; struct i2c_client *client; struct i2c_board_info brdinfo; - u16 bus; + int nr; }; /** -- 2.1.4