Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4320603imu; Mon, 14 Jan 2019 20:26:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN6CzR6pwC4Be6tAJYhZnrvVlWxhJ41UD5KQEx4J1JdVjacb8Y8Ss/ficLQTa76xz4VoWi/I X-Received: by 2002:a17:902:50e3:: with SMTP id c32mr2102440plj.318.1547526399069; Mon, 14 Jan 2019 20:26:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547526399; cv=none; d=google.com; s=arc-20160816; b=TlYX6Z8sKez/RvgncnA2nkjDmXiZG/xg7d14yp4pV1MhHGC43cGDqu29MSI2vcykf3 sFN68Y8D11Ws3HVloBqEQBCqcqyXVDNV6VZQiV02cso8+8mLggCiWg3RZsCLjiwpA4AI aSVFa2/6k6ZolZjuk50aUp4hq6Zk7UJNJjSkExlNdhK/Ke6VSdr/wqIsqiS84aIxULyC 9sEVy1Rpnf64UBbVzNVrBiwMUsYpwhS+9K0BxSnRA4SXbuGJjzST2T5Qpqo7zPsQLYz2 0fzX45U5hWIOkgyMRjCibK9tVCGtRVy7d3eYUL3lLKqbcpUg4rd3itIR2SN7zXfnR3MB Skzg== 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=88tr3lXC17j0hxp31Q9d3Chx35RSe2lvXGFO5Hei5VY=; b=MtIogsCsk3IjMw9Xc77Ec7bF6i7b5i4I6Ny7dR3NarAo1kBboY3HccGbS0ylKH6y6L HK6TcAdoH6UV73lSn11G1SJZKcCx9/JnW4HHh0NWEVU3rA+cVpmiTcKy1D02zLxXnDEa TB9pM9X4b5rktwoYT8GLc0VVvWMBVbESBWUuhBCjRF8uoULGnCHuqr2eMql2ty7DnCoj 9vPxvjPgWySwgGHaTNR7u1WmyKrpVQ3etZ6S2n7XPV4GL4PiEQDDWYVR/mBCdcczOcXY YpxD8kPfG2QLTTOAuC2dOi5JTT14FpkZ4sTO1qtYm6qzb+LiiBM3M4KNIfC51lPsx/wN 6+TA== 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 m9si2096234pll.349.2019.01.14.20.26.23; Mon, 14 Jan 2019 20:26:39 -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 S1728285AbfAOEWc (ORCPT + 99 others); Mon, 14 Jan 2019 23:22:32 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:37582 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728229AbfAOEWa (ORCPT ); Mon, 14 Jan 2019 23:22:30 -0500 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id E6ACD29E86; Mon, 14 Jan 2019 23:22:24 -0500 (EST) To: Arnd Bergmann , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org Message-Id: <959d4937f28b0823fc8bc5a618b196a33bbb1fbe.1547525936.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH v9 21/22] char/generic_nvram: Remove as unused Date: Tue, 15 Jan 2019 15:18:56 +1100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Finn Thain --- drivers/char/Makefile | 6 +- drivers/char/generic_nvram.c | 160 ----------------------------------- 2 files changed, 1 insertion(+), 165 deletions(-) delete mode 100644 drivers/char/generic_nvram.c diff --git a/drivers/char/Makefile b/drivers/char/Makefile index b8d42b4e979b..fbea7dd12932 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -26,11 +26,7 @@ obj-$(CONFIG_RTC) += rtc.o obj-$(CONFIG_HPET) += hpet.o obj-$(CONFIG_EFI_RTC) += efirtc.o obj-$(CONFIG_XILINX_HWICAP) += xilinx_hwicap/ -ifeq ($(CONFIG_GENERIC_NVRAM),y) - obj-$(CONFIG_NVRAM) += generic_nvram.o -else - obj-$(CONFIG_NVRAM) += nvram.o -endif +obj-$(CONFIG_NVRAM) += nvram.o obj-$(CONFIG_TOSHIBA) += toshiba.o obj-$(CONFIG_DS1620) += ds1620.o obj-$(CONFIG_HW_RANDOM) += hw_random/ diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c deleted file mode 100644 index 0c22b9503e84..000000000000 --- a/drivers/char/generic_nvram.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Generic /dev/nvram driver for architectures providing some - * "generic" hooks, that is : - * - * nvram_read_byte, nvram_write_byte, nvram_sync, nvram_get_size - * - * Note that an additional hook is supported for PowerMac only - * for getting the nvram "partition" informations - * - */ - -#define NVRAM_VERSION "1.1" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef CONFIG_PPC_PMAC -#include -#endif - -#define NVRAM_SIZE 8192 - -static DEFINE_MUTEX(nvram_mutex); -static ssize_t nvram_len; - -static loff_t nvram_llseek(struct file *file, loff_t offset, int origin) -{ - return generic_file_llseek_size(file, offset, origin, - MAX_LFS_FILESIZE, nvram_len); -} - -static ssize_t read_nvram(struct file *file, char __user *buf, - size_t count, loff_t *ppos) -{ - unsigned int i; - char __user *p = buf; - - if (!access_ok(buf, count)) - return -EFAULT; - if (*ppos >= nvram_len) - return 0; - for (i = *ppos; count > 0 && i < nvram_len; ++i, ++p, --count) - if (__put_user(nvram_read_byte(i), p)) - return -EFAULT; - *ppos = i; - return p - buf; -} - -static ssize_t write_nvram(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - unsigned int i; - const char __user *p = buf; - char c; - - if (!access_ok(buf, count)) - return -EFAULT; - if (*ppos >= nvram_len) - return 0; - for (i = *ppos; count > 0 && i < nvram_len; ++i, ++p, --count) { - if (__get_user(c, p)) - return -EFAULT; - nvram_write_byte(c, i); - } - *ppos = i; - return p - buf; -} - -static int nvram_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -{ - switch(cmd) { -#ifdef CONFIG_PPC_PMAC - case OBSOLETE_PMAC_NVRAM_GET_OFFSET: - printk(KERN_WARNING "nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n"); - case IOC_NVRAM_GET_OFFSET: { - int part, offset; - - if (!machine_is(powermac)) - return -EINVAL; - if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0) - return -EFAULT; - if (part < pmac_nvram_OF || part > pmac_nvram_NR) - return -EINVAL; - offset = pmac_get_partition(part); - if (copy_to_user((void __user*)arg, &offset, sizeof(offset)) != 0) - return -EFAULT; - break; - } -#endif /* CONFIG_PPC_PMAC */ - case IOC_NVRAM_SYNC: - nvram_sync(); - break; - default: - return -EINVAL; - } - - return 0; -} - -static long nvram_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -{ - int ret; - - mutex_lock(&nvram_mutex); - ret = nvram_ioctl(file, cmd, arg); - mutex_unlock(&nvram_mutex); - - return ret; -} - -const struct file_operations nvram_fops = { - .owner = THIS_MODULE, - .llseek = nvram_llseek, - .read = read_nvram, - .write = write_nvram, - .unlocked_ioctl = nvram_unlocked_ioctl, -}; - -static struct miscdevice nvram_dev = { - NVRAM_MINOR, - "nvram", - &nvram_fops -}; - -int __init nvram_init(void) -{ - int ret = 0; - - printk(KERN_INFO "Generic non-volatile memory driver v%s\n", - NVRAM_VERSION); - ret = misc_register(&nvram_dev); - if (ret != 0) - goto out; - - nvram_len = nvram_get_size(); - if (nvram_len < 0) - nvram_len = NVRAM_SIZE; - -out: - return ret; -} - -void __exit nvram_cleanup(void) -{ - misc_deregister( &nvram_dev ); -} - -module_init(nvram_init); -module_exit(nvram_cleanup); -MODULE_LICENSE("GPL"); -- 2.19.2