Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1208155

Re: [PATCH] driver/i2c/mux: Add register based mux i2c-mux-reg

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Wolfram Sang <wsa@the-dreams.de>
Newsgroups linux.kernel
Subject Re: [PATCH] driver/i2c/mux: Add register based mux i2c-mux-reg
Date Sat, 15 Aug 2015 22:30:02 +0200
Message-ID <pXQfw-3IN-7@gated-at.bofh.it> (permalink)
References <pC2Qr-GT-31@gated-at.bofh.it>
X-Original-To York Sun <yorksun@freescale.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.23 (2014-03-12)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 50
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, Peter Korsgaard <peter.korsgaard@barco.com>
X-Original-Date Sat, 15 Aug 2015 22:23:05 +0200
X-Original-Message-ID <20150815202302.GB3463@katana>
X-Original-References <1434475692-4611-1-git-send-email-yorksun@freescale.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1208155

Show key headers only | View raw


On Tue, Jun 16, 2015 at 10:28:12AM -0700, York Sun wrote:
> Based on i2c-mux-gpio driver, similarly the register based mux
> switch from one bus to another by setting a single register.
> The register can be on PCIe bus, local bus, or any memory-mapped
> address.
> 
> Signed-off-by: York Sun <yorksun@freescale.com>
> CC: Wolfram Sang <wsa@the-dreams.de>
> CC: Peter Korsgaard <peter.korsgaard@barco.com>

Mostly good.

> +static int i2c_mux_reg_probe(struct platform_device *pdev)
> +{
> +	struct regmux *mux;
> +	struct i2c_adapter *parent;
> +	struct resource *res;
> +	int (*deselect)(struct i2c_adapter *, void *, u32);
> +	unsigned int initial_state, class;

gcc says:

drivers/i2c/muxes/i2c-mux-reg.c:182:15: warning: variable 'initial_state' set but not used [-Wunused-but-set-variable]

It seens you prepared for setting the initial state but don't do the
actual set?

> +static struct platform_driver i2c_mux_reg_driver = {
> +	.probe	= i2c_mux_reg_probe,
> +	.remove	= i2c_mux_reg_remove,
> +	.driver	= {
> +		.owner	= THIS_MODULE,

coccicheck says:

drivers/i2c/muxes/i2c-mux-reg.c:288:3-8: No need to set .owner here. The core will do it.

> +		.name	= "i2c-mux-reg",
> +	},
> +};

Thanks,

   Wolfram

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] driver/i2c/mux: Add register based mux i2c-mux-reg Wolfram Sang <wsa@the-dreams.de> - 2015-08-15 22:30 +0200
  Re: [PATCH] driver/i2c/mux: Add register based mux i2c-mux-reg Wolfram Sang <wsa@the-dreams.de> - 2015-08-18 18:50 +0200

csiph-web