Path: csiph.com!news.mixmin.net!news.albasani.net!weretis.net!feeder4.news.weretis.net!storethat.news.telefonica.de!telefonica.de!news.panservice.it!bofh.it!news.nic.it!robomod From: Srinivas Kandagatla Newsgroups: linux.kernel Subject: Re: [PATCH 4/6] eeprom: at25: Remove in kernel API for accessing the EEPROM Date: Tue, 15 Dec 2015 11:10:03 +0100 Message-ID: References: X-Original-To: Andrew Lunn , GregKH , maxime.ripard@free-electrons.com, wsa@the-dreams.de, broonie@kernel.org, vz@mleia.com Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=0KUaY1t5VFUxuvb3P/GQYVa0Sz1cNB4c8t7myVkAANg=; b=W12KGKjXk9JTGgUbPkFcfKfskM9ygI4CHmDvnRqqTiNQn7x2po5q6U2d3dd9G8QwST o0hgP2RKz3fWaR1eWEw0Y8j2H8EahwW89kA13922EepsSniqZRt4dP/JPZnEbcxv1o5H k78eARgsMGg96ZNxmG2EBSk6KtNCxdRpXvXAM= X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=0KUaY1t5VFUxuvb3P/GQYVa0Sz1cNB4c8t7myVkAANg=; b=dKRqudRavJ1rnLSadGxBwkgkvVKH+Qjmnf3J0TqEtNPprRsIPQenNGAXzSX0UtDQHq w4/OiUPnUA9F6fnNgjCQ+REh9oLPCSeceR594heJFogIgXpMwJykMVhtmJpre7GPE1sp 89GxTY13sV+ck7WA+b5DrUAobxulsJU80pKRgKMFbVXKUfn+EcVKf8EtLslRDc8RUnG3 2VxJJSAzadp7z3ORcP+MLc5jktYFi+hIcC/Vrdk561q9+mIWv8GayznKn4AfR8PSf7Ul dV2SslJUoVpMkEgNgCDLTjWI110fAHqTunOFfc+V6oyvu2CWEsM4dT3OmhvXzE91lEMf kBkQ== X-Gm-Message-State: ALoCoQm+GEL4ZKglEb6MraI7Bm+vFjSPzIU/2QfRqKWEijwhoiD90MiGUfGZOITqFdqA5EgHTmKfeODscBVGimt74HMIjFLoGg== X-Received: by 10.28.22.139 with SMTP id 133mr3845480wmw.36.1450173870360; Tue, 15 Dec 2015 02:04:30 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 101 Organization: linux.* mail to news gateway X-Original-Cc: afd@ti.com, linux-kernel@vger.kernel.org X-Original-Date: Tue, 15 Dec 2015 10:04:16 +0000 X-Original-Message-ID: <566FE5A0.4050204@linaro.org> X-Original-References: <1449583511-22521-1-git-send-email-andrew@lunn.ch> <1449583511-22521-5-git-send-email-andrew@lunn.ch> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1292009 On 08/12/15 14:05, Andrew Lunn wrote: > The setup() callback is not used by any in kernel code. Remove it. > Any new code which requires access to the eeprom can use the NVMEM > API. > > Signed-off-by: Andrew Lunn > --- > drivers/misc/eeprom/at25.c | 26 -------------------------- > include/linux/spi/eeprom.h | 2 -- > 2 files changed, 28 deletions(-) > This is nice, The memory_accessor users can still use the nvmem_device_get() by passing the nvmem provider device_name which would give a handle to nvmem_device. --srini > diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c > index f850ef556bcc..4732f6997289 100644 > --- a/drivers/misc/eeprom/at25.c > +++ b/drivers/misc/eeprom/at25.c > @@ -29,7 +29,6 @@ > > struct at25_data { > struct spi_device *spi; > - struct memory_accessor mem; > struct mutex lock; > struct spi_eeprom chip; > struct bin_attribute bin; > @@ -281,26 +280,6 @@ at25_bin_write(struct file *filp, struct kobject *kobj, > > /*-------------------------------------------------------------------------*/ > > -/* Let in-kernel code access the eeprom data. */ > - > -static ssize_t at25_mem_read(struct memory_accessor *mem, char *buf, > - off_t offset, size_t count) > -{ > - struct at25_data *at25 = container_of(mem, struct at25_data, mem); > - > - return at25_ee_read(at25, buf, offset, count); > -} > - > -static ssize_t at25_mem_write(struct memory_accessor *mem, const char *buf, > - off_t offset, size_t count) > -{ > - struct at25_data *at25 = container_of(mem, struct at25_data, mem); > - > - return at25_ee_write(at25, buf, offset, count); > -} > - > -/*-------------------------------------------------------------------------*/ > - > static int at25_fw_to_chip(struct device *dev, struct spi_eeprom *chip) > { > u32 val; > @@ -415,22 +394,17 @@ static int at25_probe(struct spi_device *spi) > at25->bin.attr.name = "eeprom"; > at25->bin.attr.mode = S_IRUSR; > at25->bin.read = at25_bin_read; > - at25->mem.read = at25_mem_read; > > at25->bin.size = at25->chip.byte_len; > if (!(chip.flags & EE_READONLY)) { > at25->bin.write = at25_bin_write; > at25->bin.attr.mode |= S_IWUSR; > - at25->mem.write = at25_mem_write; > } > > err = sysfs_create_bin_file(&spi->dev.kobj, &at25->bin); > if (err) > return err; > > - if (chip.setup) > - chip.setup(&at25->mem, chip.context); > - > dev_info(&spi->dev, "%Zd %s %s eeprom%s, pagesize %u\n", > (at25->bin.size < 1024) > ? at25->bin.size > diff --git a/include/linux/spi/eeprom.h b/include/linux/spi/eeprom.h > index 403e007aef68..e34e169f9dcb 100644 > --- a/include/linux/spi/eeprom.h > +++ b/include/linux/spi/eeprom.h > @@ -30,8 +30,6 @@ struct spi_eeprom { > */ > #define EE_INSTR_BIT3_IS_ADDR 0x0010 > > - /* for exporting this chip's data to other kernel code */ > - void (*setup)(struct memory_accessor *mem, void *context); > void *context; > }; > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/