Received: by 10.223.176.46 with SMTP id f43csp4537525wra; Tue, 23 Jan 2018 10:39:27 -0800 (PST) X-Google-Smtp-Source: AH8x225LWoDmReIYY647yt6xDLqMTDJEF48jidLhL9MYiaJH/lvPaBY42MdzzsFCcuqihskwQp2V X-Received: by 10.36.48.198 with SMTP id q189mr4917234itq.83.1516732767751; Tue, 23 Jan 2018 10:39:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516732767; cv=none; d=google.com; s=arc-20160816; b=q/4v7vxlz4Kv4Nnt9Q5ydWMMSFCnAOMlyMDCh2xvnqtnFqlMD4h4fbcoLwA3IlZHMf R8Wlmgx2UUJGQ0ZG8SCbR/SNTFkKo+xdz7CcSYySGVt/+Z0N30Vek8/Rvfx2SFdOxe7Z BfPrWjUx3rYyz4S6TS0O6dGwmqVf/ewGMUuOKM3XvMfoxGvjCM7H9c4dalq+uKrjXe33 xGaJ3awLraztvdnCFYDU9chauxto9SB4iZoyGF2gm0XqsDSLpe4B96/4ZvCk6+8jZRMp usddsz9C8JAf5y7Kx4UFATbwMPdEu+fFe833lpwQvDAs2M6gk1152qyJPhczH/obbTXw PjIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=nLJaOAVW51mOiPFgrk6Ot0WlkepnG6y97bF4nRV8SYU=; b=BEcnDczIQvwZurJBd2yQTDsFPqgv8fwE06U8vsuUI3RRPMRryaGsq07iYQcMN742Y1 DmFTloLSfy4mPxiW6lFAeNdpTyV7OMOnn9y4iHEpuOEzi5cOYNLLmzW+0jY9TKukKqm0 7EwHXANbQLtaZIFOK58R91sb9EMFynTTxX9RervC9ItmoRtI02ifX+4og5pG2Z3NqbRC p9K07XE0E1qlocBa7JjJ5JrqasSIgWwNcRm44d3OKkMdhFCZ+2Z1HvGGGgTWXbGzG6hr JzggYHvxFlSdwxOV0lhB/0iuiXvZpKh3ZyJyqMOhrpQu2Onpk2VzREkjhoqZDI/VOBKG Oe/g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q123si15470931iof.93.2018.01.23.10.39.14; Tue, 23 Jan 2018 10:39:27 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752526AbeAWSiV (ORCPT + 99 others); Tue, 23 Jan 2018 13:38:21 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:40338 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752473AbeAWSiR (ORCPT ); Tue, 23 Jan 2018 13:38:17 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from vadimp@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Jan 2018 20:38:09 +0200 Received: from r-mgtswh-226.mtr.labs.mlnx. (r-mgtswh-226.mtr.labs.mlnx [10.209.1.51]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w0NIbwiK013755; Tue, 23 Jan 2018 20:38:09 +0200 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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