From patchwork Tue Sep 22 22:06:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 7246111 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 925C2BEEC1 for ; Tue, 22 Sep 2015 22:06:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A044720631 for ; Tue, 22 Sep 2015 22:06:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3007320621 for ; Tue, 22 Sep 2015 22:06:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934927AbbIVWG0 (ORCPT ); Tue, 22 Sep 2015 18:06:26 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:35920 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934922AbbIVWGZ (ORCPT ); Tue, 22 Sep 2015 18:06:25 -0400 Received: by lacao8 with SMTP id ao8so6862774lac.3 for ; Tue, 22 Sep 2015 15:06:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=YkAUfpkS53V1m2bF04FPZ2mAUHt2Czi6v5DU1ro0cIQ=; b=gAbgOKqzl7XDMbTzSzPf2WHNrNhGgJPo/Im/xyf5G4/Z+YL3m6x2kC+p5fr0yVEGLU q8idWCIKnR3nMFL7eamSGQyFG7BFAvFypBq7aYPufXcDpkaZvs3hS55gqaecih6ZN/2c LMmDt7rF8EoZTyzAwyV4K23hHmKcsMtR3bRoPAcyhCbXo/Qtj8A2qhSzMmN7EHHPNp7A puxqGEGhBogusHXlqaGIFiAkvITb7zgq7r3aNa+wBcDnenfj8x5FMzewLQKhXVKwY9z9 kUgrAbNw3geiXsL/IA+g0t9cisR8uRSGMHDkS70TblcMzPcnXm1kOia1V4I2car1qfv3 mKmw== X-Gm-Message-State: ALoCoQmV4NkzK4C6L3ReFtwLXT0rY8t2nq40L1yX/o9/+ipxzY+IrFxSBqJPn9Xn2WzPtDRr0HD7 X-Received: by 10.25.78.79 with SMTP id c76mr3137849lfb.18.1442959583889; Tue, 22 Sep 2015 15:06:23 -0700 (PDT) Received: from wasted.cogentembedded.com (ppp83-237-255-126.pppoe.mtu-net.ru. [83.237.255.126]) by smtp.gmail.com with ESMTPSA id k12sm272580lfb.44.2015.09.22.15.06.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2015 15:06:22 -0700 (PDT) From: Sergei Shtylyov To: linus.walleij@linaro.org, linux-sh@vger.kernel.org, laurent.pinchart@ideasonboard.com, linux-gpio@vger.kernel.org Subject: [PATCH v2] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file Date: Wed, 23 Sep 2015 01:06:21 +0300 Message-ID: <20048813.n6aqe5klWJ@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.9 (Linux/4.1.6-100.fc21.x86_64; KDE/4.14.9; x86_64; ; ) In-Reply-To: <13219129.kD4pZSmcAP@wasted.cogentembedded.com> References: <13219129.kD4pZSmcAP@wasted.cogentembedded.com> MIME-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP R8A7790/1 PFC drivers use almost identical 'union vin_data' and completely identical VIN_DATA_PIN_GROUP() macro; we thus can move them into the shared header file... Suggested-by: Geert Uytterhoeven Signed-off-by: Sergei Shtylyov Acked-by: Geert Uytterhoeven Acked-by: Laurent Pinchart --- The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo. Changed in version 2: - removed leftover empty line from the R8A7790 driver; - added Geert's ACK. drivers/pinctrl/sh-pfc/pfc-r8a7790.c | 19 ------------------- drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 18 ------------------ drivers/pinctrl/sh-pfc/sh_pfc.h | 18 ++++++++++++++++++ 3 files changed, 18 insertions(+), 37 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: renesas/drivers/pinctrl/sh-pfc/pfc-r8a7790.c =================================================================== --- renesas.orig/drivers/pinctrl/sh-pfc/pfc-r8a7790.c +++ renesas/drivers/pinctrl/sh-pfc/pfc-r8a7790.c @@ -3624,25 +3624,6 @@ static const unsigned int usb2_pins[] = static const unsigned int usb2_mux[] = { USB2_PWEN_MARK, USB2_OVC_MARK, }; - -union vin_data { - unsigned int data24[24]; - unsigned int data20[20]; - unsigned int data16[16]; - unsigned int data12[12]; - unsigned int data10[10]; - unsigned int data8[8]; - unsigned int data4[4]; -}; - -#define VIN_DATA_PIN_GROUP(n, s) \ - { \ - .name = #n#s, \ - .pins = n##_pins.data##s, \ - .mux = n##_mux.data##s, \ - .nr_pins = ARRAY_SIZE(n##_pins.data##s), \ - } - /* - VIN0 ------------------------------------------------------------------- */ static const union vin_data vin0_data_pins = { .data24 = { Index: renesas/drivers/pinctrl/sh-pfc/pfc-r8a7791.c =================================================================== --- renesas.orig/drivers/pinctrl/sh-pfc/pfc-r8a7791.c +++ renesas/drivers/pinctrl/sh-pfc/pfc-r8a7791.c @@ -3986,24 +3986,6 @@ static const unsigned int usb1_mux[] = { USB1_PWEN_MARK, USB1_OVC_MARK, }; - -union vin_data { - unsigned int data24[24]; - unsigned int data20[20]; - unsigned int data16[16]; - unsigned int data12[12]; - unsigned int data10[10]; - unsigned int data8[8]; -}; - -#define VIN_DATA_PIN_GROUP(n, s) \ - { \ - .name = #n#s, \ - .pins = n##_pins.data##s, \ - .mux = n##_mux.data##s, \ - .nr_pins = ARRAY_SIZE(n##_pins.data##s), \ - } - /* - VIN0 ------------------------------------------------------------------- */ static const union vin_data vin0_data_pins = { .data24 = { Index: renesas/drivers/pinctrl/sh-pfc/sh_pfc.h =================================================================== --- renesas.orig/drivers/pinctrl/sh-pfc/sh_pfc.h +++ renesas/drivers/pinctrl/sh-pfc/sh_pfc.h @@ -52,6 +52,24 @@ struct sh_pfc_pin_group { unsigned int nr_pins; }; +#define VIN_DATA_PIN_GROUP(n, s) \ + { \ + .name = #n#s, \ + .pins = n##_pins.data##s, \ + .mux = n##_mux.data##s, \ + .nr_pins = ARRAY_SIZE(n##_pins.data##s), \ + } + +union vin_data { + unsigned int data24[24]; + unsigned int data20[20]; + unsigned int data16[16]; + unsigned int data12[12]; + unsigned int data10[10]; + unsigned int data8[8]; + unsigned int data4[4]; +}; + #define SH_PFC_FUNCTION(n) \ { \ .name = #n, \