lkml.org 
[lkml]   [2015]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2015-06-15 20:41    [W:1.200 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site