From patchwork Fri Aug 28 20:39:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 7093721 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DB4F29F32B for ; Fri, 28 Aug 2015 20:39:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D532D20869 for ; Fri, 28 Aug 2015 20:39:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB4BD20860 for ; Fri, 28 Aug 2015 20:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752645AbbH1Ujm (ORCPT ); Fri, 28 Aug 2015 16:39:42 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:35424 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752613AbbH1Ujl (ORCPT ); Fri, 28 Aug 2015 16:39:41 -0400 Received: by lbcbn3 with SMTP id bn3so36467248lbc.2 for ; Fri, 28 Aug 2015 13:39:40 -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=ocTbNkCv6Ri09Mjozub8VbOyzWCBIiLOaSxvI/H/ibE=; b=CXcI+q/F0Usvg6fYzLg8z83JaSUrJFKj59q/i0E/Bqa/ynJOcl9guGvLCxDXrqP8hc IweomZf62ZrgeOfm07IYDvtGfio2AmKvA9Q9GvaRmwj1QXTYXCWusPvi9Cp8k5bEAWv5 n0o6Qd7Pv1R//3hZELGGsCAeKfcSPRqkIDNjALbTpSRokBUYst9Zlh+kHYmO1rAALpBS Fk2r47klgvsn80BaOn/b2tKx/WvBiulweO/X3JpYB76thz43utsIIvXYKrIc0FrWMeVC mAZRMP1uKuzfnPEfZFSUmJk3G6OREbN7u/kiyFxsv/xMAi8JmtbhpC5rNKg1Kt1M4acU th6w== X-Gm-Message-State: ALoCoQkefQxAblTceXdcEDyRhAmDenSwYdTKz8zDssAhTmEgUDTCtElgVOjZlvVSV0DWiDsTgzTR X-Received: by 10.112.148.130 with SMTP id ts2mr5650249lbb.17.1440794379922; Fri, 28 Aug 2015 13:39:39 -0700 (PDT) Received: from wasted.cogentembedded.com (ppp24-212.pppoe.mtu-net.ru. [81.195.24.212]) by smtp.gmail.com with ESMTPSA id cy1sm1700045lac.22.2015.08.28.13.39.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2015 13:39:39 -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] pinctrl: sh-pfc: r8a779[01]: move 'union vin_data' to shared header file Date: Fri, 28 Aug 2015 23:39:36 +0300 Message-ID: <4177542.1tOnYXlTVP@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.9 (Linux/4.1.5-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=-8.3 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 --- The patch is against the 'devel' branch of Linus W.'s 'linux-pinctrl.git' repo. drivers/pinctrl/sh-pfc/pfc-r8a7790.c | 18 ------------------ drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 18 ------------------ drivers/pinctrl/sh-pfc/sh_pfc.h | 18 ++++++++++++++++++ 3 files changed, 18 insertions(+), 36 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: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7790.c =================================================================== --- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7790.c +++ linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7790.c @@ -3625,24 +3625,6 @@ 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: linux-pinctrl/drivers/pinctrl/sh-pfc/pfc-r8a7791.c =================================================================== --- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/pfc-r8a7791.c +++ linux-pinctrl/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: linux-pinctrl/drivers/pinctrl/sh-pfc/sh_pfc.h =================================================================== --- linux-pinctrl.orig/drivers/pinctrl/sh-pfc/sh_pfc.h +++ linux-pinctrl/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, \