Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1933532ybc; Wed, 20 Nov 2019 06:27:03 -0800 (PST) X-Google-Smtp-Source: APXvYqw462u3en5K8trFP/QLTfxoFY+sFCUkctFyKlpOk1s5MXlFFcf5I99ZQparGGr36aXCgjkM X-Received: by 2002:a17:906:2e5a:: with SMTP id r26mr5778968eji.283.1574260023133; Wed, 20 Nov 2019 06:27:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574260023; cv=none; d=google.com; s=arc-20160816; b=0MQFlH96Qhsj43J0ss0su+g8lfkIbjXe6ZWnMRQt002z89seF9itTi9gl6yetYkVxF gKy8Jz5r6hiULyVYcwEcuBZ6rdcWMHhWdmXdxCTELn5bl652xVGuKmrmzaADqgZ7dPCg fzg1KbHIrphUkKir/76o73bPHCUw7TnQfuxuSVhfwFKFnKLoCGLYmq+GChyBc5tZuxaj h7v+ESU7keerNO5zMsrtuCRyc8UsVMagS10ef/nF66kljyyGKL60RbkcqsfHVHwMQ6SJ 6+gPA+21iQPJCB6EjdkHLd/5OEHXJ99RKU8WC4/8+Y3ZF4t9yiU3eSxNG8K8fNtovAPa HpLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Hc8hYB3tbZIod+IQ6MbwVcYHzkJ7GhB4LPUoKfpHBhg=; b=xh+QfO/AWJMao05QdT3AJrEVE+uwylMt0dUYv61yKVx5Ln+Qo70PVjZ8HdoSk7k1qv /L7vZvzuA5o8B6uc35l/Mz0b+zp39zTj4Xf5HR18Yazkp73KoDucmqw7Um4Grm9GkC58 zaRhVZFCeQMTeD1fuMMJZ+OPFtkZoLB/3ByFlfceumNrUmWglcLVdwjlL5i+Qsdpw//m xp3+q4ZQ3q3j88paX64js/dgTd2rvL3spBHm0dolbK7NUbsloI93BROoAVPgTlF39QvA bzrknZxz4liYdAfc7y6SW+ISE4/9qcwp0muEx6rrlhkHY0jwvh8xS6dIVfTN5hgRyP0C e0bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=bbGGdIG8; 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 y9si16425399ejp.175.2019.11.20.06.26.38; Wed, 20 Nov 2019 06:27:03 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=bbGGdIG8; 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 S1731616AbfKTOV1 (ORCPT + 99 others); Wed, 20 Nov 2019 09:21:27 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40389 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730018AbfKTOVU (ORCPT ); Wed, 20 Nov 2019 09:21:20 -0500 Received: by mail-wm1-f68.google.com with SMTP id y5so1832699wmi.5 for ; Wed, 20 Nov 2019 06:21:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Hc8hYB3tbZIod+IQ6MbwVcYHzkJ7GhB4LPUoKfpHBhg=; b=bbGGdIG8CJ1VEwyvm3y8H9OEzouxX5YUlVCLvoh6v+C2mp5+I3HC5s5lrDBbxANKk1 cW3mLQhthQBpB6dK1G8UH5qpHOayPMkgVbLUim7e2ePY/pq0TNd5Add/viZsjSZQl+si //3W73zDWghkbFXIWkkWUPHTfv4GUJFnmTEdzN9U/9pWsk+dVTAfD0F6wnhVRf36ISDi CZTcdbRZPmQ1EfsMkC1gq3kwLiieQA48/nSscfZhpIgL5hO5bxJKF9O2KIHQRMCfCto4 1uRDYDVbbUUvqxjiUkoHfHQe6cKiJGK/6NlZdiR4Q5tdmuFEBN7pqTQp6iC0fEqVH2AW jGtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Hc8hYB3tbZIod+IQ6MbwVcYHzkJ7GhB4LPUoKfpHBhg=; b=o+k4AWh53bbkPH31KmK94+jLFvPdqNrXozwI8Df4etI6Uyudd5+OtMHjeuXTfdq2hi Esi/Tquci0mCMmdwOzSvVpgVdtC4/PivzmxD2SSThFgGrWN7jQ2t9dA3NTqxOudbCR55 C20d1nsuKkjhCPWhm+gfpCARxTBa5lqSXC5qVqBizmtwEcWVYUk8+0e/uf6PYz+PW2ny 9MNq25q3IIXARKWYEFs55EXm+c06wbkDbtHu5+pDXKUDb74TKP1+chI6DPqOSAU61CDG QcnmbLnTgUlOgZFtQeAa5Z+Ys9z+zdNOx2DwNtim4j0Snk+vXrKPERqx6MH/FtzAWYoC vR6w== X-Gm-Message-State: APjAAAUH/5ad5gaA42SgOOC2UnNlBtemOakRad5vmYYMxS4DtMcI/6nR 0snzm69pGzfV8nJ77wZg056lcg== X-Received: by 2002:a1c:7d16:: with SMTP id y22mr3453604wmc.106.1574259678325; Wed, 20 Nov 2019 06:21:18 -0800 (PST) Received: from khouloud-ThinkPad-T470p.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a6sm34544352wrh.69.2019.11.20.06.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2019 06:21:17 -0800 (PST) From: Khouloud Touil To: bgolaszewski@baylibre.com, robh+dt@kernel.org, mark.rutland@arm.com, srinivas.kandagatla@linaro.org, baylibre-upstreaming@groups.io Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-i2c@vger.kernel.org, linus.walleij@linaro.org, Khouloud Touil Subject: [PATCH 4/4] eeprom: at24: remove the write-protect pin support Date: Wed, 20 Nov 2019 15:20:38 +0100 Message-Id: <20191120142038.30746-5-ktouil@baylibre.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191120142038.30746-1-ktouil@baylibre.com> References: <20191120142038.30746-1-ktouil@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NVMEM framework is an interface for the at24 EEPROMs as well as for other drivers, instead of passing the wp-gpios over the different drivers each time, it would be better to pass it over the NVMEM subsystem once and for all. Removing the support for the write-protect pin after adding it to the NVMEM subsystem. Signed-off-by: Khouloud Touil --- drivers/misc/eeprom/at24.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index 2cccd82a3106..eec2a34b7051 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -22,7 +22,6 @@ #include #include #include -#include /* Address pointer is 16 bit. */ #define AT24_FLAG_ADDR16 BIT(7) @@ -89,8 +88,6 @@ struct at24_data { struct nvmem_device *nvmem; - struct gpio_desc *wp_gpio; - /* * Some chips tie up multiple I2C addresses; dummy devices reserve * them for us, and we'll use them with SMBus calls. @@ -457,12 +454,10 @@ static int at24_write(void *priv, unsigned int off, void *val, size_t count) * from this host, but not from other I2C masters. */ mutex_lock(&at24->lock); - gpiod_set_value_cansleep(at24->wp_gpio, 0); while (count) { ret = at24_regmap_write(at24, buf, off, count); if (ret < 0) { - gpiod_set_value_cansleep(at24->wp_gpio, 1); mutex_unlock(&at24->lock); pm_runtime_put(dev); return ret; @@ -472,7 +467,6 @@ static int at24_write(void *priv, unsigned int off, void *val, size_t count) count -= ret; } - gpiod_set_value_cansleep(at24->wp_gpio, 1); mutex_unlock(&at24->lock); pm_runtime_put(dev); @@ -662,9 +656,6 @@ static int at24_probe(struct i2c_client *client) at24->client[0].client = client; at24->client[0].regmap = regmap; - at24->wp_gpio = devm_gpiod_get_optional(dev, "wp", GPIOD_OUT_HIGH); - if (IS_ERR(at24->wp_gpio)) - return PTR_ERR(at24->wp_gpio); writable = !(flags & AT24_FLAG_READONLY); if (writable) { -- 2.17.1