Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758925AbaDJRw0 (ORCPT ); Thu, 10 Apr 2014 13:52:26 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:52803 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758895AbaDJRwS (ORCPT ); Thu, 10 Apr 2014 13:52:18 -0400 MIME-Version: 1.0 In-Reply-To: <533BA67B.6070905@monstr.eu> References: <1395933906-2268-1-git-send-email-harinik@xilinx.com> <533BA67B.6070905@monstr.eu> Date: Thu, 10 Apr 2014 19:52:18 +0200 Message-ID: Subject: Re: [PATCH 1/2] GPIO: Add driver for Zynq GPIO controller From: Linus Walleij To: Michal Simek Cc: Harini Katakam , Alexandre Courbot , Michal Simek , Grant Likely , Rob Herring , Pawel Moll , Mark Rutland , "ijc+devicetree@hellion.org.uk" , Kumar Gala , Rob Landley , "linux-gpio@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-doc@vger.kernel.org" , michals@xilinx.com, Ulf Hansson Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 2, 2014 at 7:56 AM, Michal Simek wrote: > On 03/31/2014 10:22 AM, Linus Walleij wrote: >> On Sat, Mar 29, 2014 at 5:44 AM, Harini Katakam >> wrote: >>> On Sat, Mar 29, 2014 at 3:20 AM, Linus Walleij wrote: >>>> On Thu, Mar 27, 2014 at 4:25 PM, Harini Katakam wrote: >> >>>>> +/* Read/Write access to the GPIO PS registers */ >>>>> +static inline u32 zynq_gpio_readreg(void __iomem *offset) >>>>> +{ >>>>> + return readl_relaxed(offset); >>>>> +} >>>>> + >>>>> +static inline void zynq_gpio_writereg(void __iomem *offset, u32 val) >>>>> +{ >>>>> + writel_relaxed(val, offset); >>>>> +} >>>> >>>> I think this is unnecessary and confusing indirection. >>>> Just use the readl_relaxed/writel_relaxed functions directly in >>>> the code. >>>> >>> >>> This is just to be flexible. >> >> Define exactly what you mean with "flexible" in this context. I >> only see unnecessary overhead and hard-to-read code. > > We have just passed this discussion for watchdog driver > here: https://lkml.org/lkml/2014/4/1/843 > > Are you ok with doing it in this way? No :-) Subsystem maintainers do not necessarily agree on such issues. Yours, Linus Walleij -- 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/