Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755439AbbFORvK (ORCPT ); Mon, 15 Jun 2015 13:51:10 -0400 Received: from down.free-electrons.com ([37.187.137.238]:43255 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750734AbbFORvC (ORCPT ); Mon, 15 Jun 2015 13:51:02 -0400 Date: Mon, 15 Jun 2015 19:50:59 +0200 From: Alexandre Belloni To: Cyrille Pitchen Cc: nicolas.ferre@atmel.com, boris.brezillon@free-electrons.com, sameo@linux.intel.com, lee.jones@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, devicetree@vger.kernel.org Subject: Re: [PATCH linux-next 2/2] mfd: flexcom: add a driver for Atmel Flexible Serial Communication Unit Message-ID: <20150615175059.GE17679@piout.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1096 Lines: 38 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/