Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5059742imu; Tue, 25 Dec 2018 16:47:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN5pMwESNEj76XWfBT2zMh+YP0TLO02ltULYaSaHX9toMdEkDxAdwWREvorswNPGbrJ6QdfB X-Received: by 2002:a17:902:a60f:: with SMTP id u15mr17116277plq.275.1545785271774; Tue, 25 Dec 2018 16:47:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545785271; cv=none; d=google.com; s=arc-20160816; b=ETaRThPYf4ew5iPoLmu9y9XoY09PlIwtn1lkOUPZ4251m5ICldZszTgVbgyQndy4PZ OWP763RVe/jjcW24LOxTpUcB8gQEUEgb3RN5B/jJ+AJlmKJnqaojIV+CKC9Ccz2KgNwa KNPOsp3v7XIu/Y2GxfgviIqPlLI3BN8HlBgJG+un/AhV1qxUvu0HplpS/VenML4+4bi6 YxpO7AiTC8RRpC1VmMLKJEr5sG7MCQOBCeivWIlIHiJHd4tq3IU6RDgUpG+8lpg/Qu1B Jl677s+tYtG7L5ivUWy4maFWCYPWzw++YUys9XE4GXcfKCcF+pEb4HkIAAbeTowRGaeM z7eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:from:references:in-reply-to :message-id:cc:to; bh=oEpNzWyHv09TCtQsPC6c/dFaIHusre8Ua6DPhn/2cKU=; b=wan8LkZ/KkTEUzHDv9p47hSZhiC5dyUZX8BuohvK2CFUhk4Xn75yA+QjJHSUCAx6Bs WTYRoUh/8Xvljg6hjwH3/ONEswKzeUBMyrQW7AjAm5odk91VRHQSdzS+G/IHrh5YUWQi AKz4rUCs3f9r+zc685cgxlTxN5t53KzNIeE1FNSpyqOtq24IMpWtYj1jWJMV0u0W1hRq 5PCPZRKKt/SvC+oksvb11PRUZnGlAq6C0Hck8FhPCDhfenT6wJMvZfREcViFAM4c4NqR QWCWQdecCWCHMgQ3NP4c3jHQDa+XV27iU0pWT9DZVZpX1o896u3xwRoGD9xdSiZw95G3 FN6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16si31628378pgh.283.2018.12.25.16.47.37; Tue, 25 Dec 2018 16:47:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729818AbeLZApo (ORCPT + 99 others); Tue, 25 Dec 2018 19:45:44 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:57340 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbeLZAoA (ORCPT ); Tue, 25 Dec 2018 19:44:00 -0500 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 2009129513; Tue, 25 Dec 2018 19:43:56 -0500 (EST) To: Arnd Bergmann , Greg Kroah-Hartman , Joshua Thompson , Geert Uytterhoeven Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org Message-Id: <535828e73145446d4f1b9916f12c853c7026ce93.1545784679.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH v8 10/25] m68k/mac: Adopt naming and calling conventions for PRAM routines Date: Wed, 26 Dec 2018 11:37:59 +1100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adopt the existing *_read_byte and *_write_byte naming convention. Rename via_pram_readbyte and via_pram_writebyte to avoid confusion. Adjust calling conventions of mac_pram_* functions to match the arch_nvram_ops struct methods. Signed-off-by: Finn Thain Acked-by: Geert Uytterhoeven Tested-by: Stan Johnson --- Changed since v7: - Removed some gratuitous function pointers. --- arch/m68k/mac/misc.c | 61 +++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index ebb3b6d169ea..9f6849deecea 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c @@ -37,7 +37,7 @@ static void (*rom_reset)(void); #ifdef CONFIG_ADB_CUDA -static __u8 cuda_read_pram(int offset) +static unsigned char cuda_pram_read_byte(int offset) { struct adb_request req; @@ -49,7 +49,7 @@ static __u8 cuda_read_pram(int offset) return req.reply[3]; } -static void cuda_write_pram(int offset, __u8 data) +static void cuda_pram_write_byte(unsigned char data, int offset) { struct adb_request req; @@ -62,7 +62,7 @@ static void cuda_write_pram(int offset, __u8 data) #endif /* CONFIG_ADB_CUDA */ #ifdef CONFIG_ADB_PMU -static __u8 pmu_read_pram(int offset) +static unsigned char pmu_pram_read_byte(int offset) { struct adb_request req; @@ -74,7 +74,7 @@ static __u8 pmu_read_pram(int offset) return req.reply[3]; } -static void pmu_write_pram(int offset, __u8 data) +static void pmu_pram_write_byte(unsigned char data, int offset) { struct adb_request req; @@ -93,7 +93,7 @@ static void pmu_write_pram(int offset, __u8 data) * the RTC should be enabled. */ -static __u8 via_pram_readbyte(void) +static __u8 via_rtc_recv(void) { int i, reg; __u8 data; @@ -120,7 +120,7 @@ static __u8 via_pram_readbyte(void) return data; } -static void via_pram_writebyte(__u8 data) +static void via_rtc_send(__u8 data) { int i, reg, bit; @@ -157,17 +157,17 @@ static void via_pram_command(int command, __u8 *data) via1[vBufB] = (via1[vBufB] | VIA1B_vRTCClk) & ~VIA1B_vRTCEnb; if (command & 0xFF00) { /* extended (two-byte) command */ - via_pram_writebyte((command & 0xFF00) >> 8); - via_pram_writebyte(command & 0xFF); + via_rtc_send((command & 0xFF00) >> 8); + via_rtc_send(command & 0xFF); is_read = command & 0x8000; } else { /* one-byte command */ - via_pram_writebyte(command); + via_rtc_send(command); is_read = command & 0x80; } if (is_read) { - *data = via_pram_readbyte(); + *data = via_rtc_recv(); } else { - via_pram_writebyte(*data); + via_rtc_send(*data); } /* All done, disable the RTC */ @@ -177,12 +177,12 @@ static void via_pram_command(int command, __u8 *data) local_irq_restore(flags); } -static __u8 via_read_pram(int offset) +static unsigned char via_pram_read_byte(int offset) { return 0; } -static void via_write_pram(int offset, __u8 data) +static void via_pram_write_byte(unsigned char data, int offset) { } @@ -326,63 +326,48 @@ static void cuda_shutdown(void) *------------------------------------------------------------------- */ -void mac_pram_read(int offset, __u8 *buffer, int len) +unsigned char mac_pram_read_byte(int addr) { - __u8 (*func)(int); - int i; - switch (macintosh_config->adb_type) { case MAC_ADB_IOP: case MAC_ADB_II: case MAC_ADB_PB1: - func = via_read_pram; - break; + return via_pram_read_byte(addr); #ifdef CONFIG_ADB_CUDA case MAC_ADB_EGRET: case MAC_ADB_CUDA: - func = cuda_read_pram; - break; + return cuda_pram_read_byte(addr); #endif #ifdef CONFIG_ADB_PMU case MAC_ADB_PB2: - func = pmu_read_pram; - break; + return pmu_pram_read_byte(addr); #endif default: - return; - } - for (i = 0 ; i < len ; i++) { - buffer[i] = (*func)(offset++); + return 0xFF; } } -void mac_pram_write(int offset, __u8 *buffer, int len) +void mac_pram_write_byte(unsigned char val, int addr) { - void (*func)(int, __u8); - int i; - switch (macintosh_config->adb_type) { case MAC_ADB_IOP: case MAC_ADB_II: case MAC_ADB_PB1: - func = via_write_pram; + via_pram_write_byte(val, addr); break; #ifdef CONFIG_ADB_CUDA case MAC_ADB_EGRET: case MAC_ADB_CUDA: - func = cuda_write_pram; + cuda_pram_write_byte(val, addr); break; #endif #ifdef CONFIG_ADB_PMU case MAC_ADB_PB2: - func = pmu_write_pram; + pmu_pram_write_byte(val, addr); break; #endif default: - return; - } - for (i = 0 ; i < len ; i++) { - (*func)(offset++, buffer[i]); + break; } } -- 2.19.2