From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F19C7C32750 for ; Fri, 2 Aug 2019 11:20:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CDEED20880 for ; Fri, 2 Aug 2019 11:20:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392324AbfHBLUN (ORCPT ); Fri, 2 Aug 2019 07:20:13 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:33004 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729311AbfHBLUN (ORCPT ); Fri, 2 Aug 2019 07:20:13 -0400 Received: by mail-qt1-f194.google.com with SMTP id r6so69212912qtt.0; Fri, 02 Aug 2019 04:20:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6svSKUB8W/2vAHAY5YVCqR8+83bHvMbbXUyJ8GuWHhs=; b=Vl32TDMoJGrn//dSjae8BtiiQXbK1GVk/KIbMF3jNGRWYACaHiYHpsZfap3j31W4oW 1BA2ejxnYg2JRRwI0gLIoyFsHc67h+13SAY00sQX8udn4tjIu/HINcaKSY81kZga1S8t Z96q1ZqfPotvz1gM8G2zfUCt8ExscRW1F+h0PNErKwUa17Di67EyRfK3i11QcIwrMbg9 UF4CXKQ8dj4VEjWIcB3WleofB9bgdF13cUL1B7ycOfdu2iwYzk1KZqn4GgwyAXd3pEqp ZyJk+a63FwkjXR3xmi2n7mIjzg1WtgsxYAO6/htVZuth3A95S1NsrU6cwDkhpCwGjOfc 17OQ== X-Gm-Message-State: APjAAAUdUndDAUq0W8zUuGURS4swB4p+GxBZ8r9A6fPJkOw5lclCpg3H rr+b//tj0sGqReIzV6FkE2Lpr4My2TzBF+YvrTk= X-Google-Smtp-Source: APXvYqzzEMPL706zJeruFWjyPx3W7qLTYqQ+nPflILZAKmqIvcLEpD7XRJHi8zMXFo3sUO3koJwU4XNqk+rw0f5qJV4= X-Received: by 2002:aed:3e7c:: with SMTP id m57mr95077214qtf.204.1564744811845; Fri, 02 Aug 2019 04:20:11 -0700 (PDT) MIME-Version: 1.0 References: <20190731195713.3150463-1-arnd@arndb.de> <20190731195713.3150463-6-arnd@arndb.de> In-Reply-To: From: Arnd Bergmann Date: Fri, 2 Aug 2019 13:19:55 +0200 Message-ID: Subject: Re: [PATCH 05/14] gpio: lpc32xx: allow building on non-lpc32xx targets To: Bartosz Golaszewski Cc: soc@kernel.org, arm-soc , Vladimir Zapolskiy , Sylvain Lemieux , Russell King , Gregory Clement , Linus Walleij , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , "David S. Miller" , Greg Kroah-Hartman , Alan Stern , Guenter Roeck , linux-gpio , netdev , linux-serial@vger.kernel.org, USB list , LINUXWATCHDOG , Lee Jones , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 2, 2019 at 9:10 AM Bartosz Golaszewski wrote: > > -#include > > -#include > > +#define _GPREG(x) (x) > > What purpose does this macro serve? > > > > > #define LPC32XX_GPIO_P3_INP_STATE _GPREG(0x000) > > #define LPC32XX_GPIO_P3_OUTP_SET _GPREG(0x004) In the existing code base, this macro converts a register offset to an __iomem pointer for a gpio register. I changed the definition of the macro here to keep the number of changes down, but I it's just as easy to remove it if you prefer. > > @@ -167,14 +166,26 @@ struct lpc32xx_gpio_chip { > > struct gpio_regs *gpio_grp; > > }; > > > > +void __iomem *gpio_reg_base; > > Any reason why this can't be made part of struct lpc32xx_gpio_chip? It could be, but it's the same for each instance, and not known until probe() time, so the same pointer would need to be copied into each instance that is otherwise read-only. Let me know if you'd prefer me to rework these two things or leave them as they are. > > +static inline u32 gpreg_read(unsigned long offset) > > Here and elsewhere: could you please keep the lpc32xx_gpio prefix for > all symbols? Sure. Arnd