lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150615175059.GE17679@piout.net>
Date:	Mon, 15 Jun 2015 19:50:59 +0200
From:	Alexandre Belloni <alexandre.belloni@...e-electrons.com>
To:	Cyrille Pitchen <cyrille.pitchen@...el.com>
Cc:	nicolas.ferre@...el.com, boris.brezillon@...e-electrons.com,
	sameo@...ux.intel.com, lee.jones@...aro.org,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	robh+dt@...nel.org, pawel.moll@....com, mark.rutland@....com,
	ijc+devicetree@...lion.org.uk, galak@...eaurora.org,
	devicetree@...r.kernel.org
Subject: Re: [PATCH linux-next 2/2] mfd: flexcom: add a driver for Atmel
 Flexible Serial Communication Unit

Hi,

On 15/06/2015 at 18:38:05 +0200, Cyrille Pitchen wrote :
> +	err = of_property_read_string(pdev->dev.of_node,
> +				      "atmel,flexcom-mode", &mode);
> +	if (err)
> +		return err;
> +
> +	if (!strcmp(mode, "usart"))
> +		mr = FX_MR_USART;
> +	else if (!strcmp(mode, "spi"))
> +		mr = FX_MR_SPI;
> +	else if (!strcmp(mode, "twi") || !strcmp(mode, "i2c"))
> +		mr = FX_MR_TWI;
> +	else
> +		return -EINVAL;
> +
> +	clk_prepare_enable(clk);
> +	version = __raw_readl(map + FX_VERSION);
> +	__raw_writel(mr, map + FX_MR);
> +	clk_disable_unprepare(clk);
> +
> +	dev_info(&pdev->dev, "version: %#x\n", version);
> +

I would also print the selected mode for debugging convenience,
especially if this is used with device tree overlays.


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ