Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1834047ybl; Thu, 19 Dec 2019 03:53:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzYef9pUgPZaqZE5zKaemNvO+xrnbYeSlIjP/a+mudXzs30jZY1CmXvfsbnHlEvfcaFvIKc X-Received: by 2002:a9d:115:: with SMTP id 21mr7823775otu.226.1576756381654; Thu, 19 Dec 2019 03:53:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576756381; cv=none; d=google.com; s=arc-20160816; b=z3jtd/HtiN9KisTk8YSLnj6lAG6FOsgTvjMYFVwZClHgL1N2LtEdva+lcMxLP9fwwf mg5v67RK8F1T3tZPIm81/31LxVMs/1yzU/W6hs1KG1hUPO8SPewZ2I5JFbCwaQ7YfFxW bs/418wSKBDZhJkKtMO6O5e294nKnQO2dYbfvLVXjbffg9HKnOcrt5liD8bYMEiG2uvS TcD8kWG9IHKFpdTPRkwbZ7JxXQfR/NaoAqJ+rCzptvejQEzLur7uAOYDF2jS2A2E58kS kJuvKzUdZ7T14QcWDLHqsxj63Tm3czU/4LLzaP98+Yd4h58N6kANS4YocjxtazYtWo+V ZpOA== 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=hbXoP0vp+PirYvwWUgyHBe1Esfy/aJnIgbBAojigrF0=; b=VyN8yYKBgDlekJA33eePMx+7RoBBfjVL9FPdGqIgYgLm0kpsC36XAr4N6z71xO0fN3 WZjkeVSvG33LdAjbM9PlRDG5+d+MBs5FIM40sTcTU43jG6L1JUH4xt1rXbmUe4E4IWi2 erBoqeYx5A9s4RYzxlJjnjAe06PgAj5TbP57cUUdGlUmFMzHINwl3F2rPkiMIlE7yQ9r bdSgHIEwBT4/WQ/E81WlriznIhJewpoHxZrs5zJjPNDwIn33/bZIQcI03OwsTgHQ+S/S dRVCA8EeE5wxLW1TM7jlltBn9NauQmWlVMEYfjhAnbihQaJRaMRKkz9Pb4U0KxLvBoal Ccfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=LypOjrsb; 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 i12si3116898oik.171.2019.12.19.03.52.50; Thu, 19 Dec 2019 03:53:01 -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=LypOjrsb; 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 S1726895AbfLSLwH (ORCPT + 99 others); Thu, 19 Dec 2019 06:52:07 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:32935 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726834AbfLSLwD (ORCPT ); Thu, 19 Dec 2019 06:52:03 -0500 Received: by mail-wm1-f66.google.com with SMTP id d139so6872196wmd.0 for ; Thu, 19 Dec 2019 03:52:02 -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=hbXoP0vp+PirYvwWUgyHBe1Esfy/aJnIgbBAojigrF0=; b=LypOjrsbEXY8+p1H8QsI/d/4m54NfYisDoA50iSu2jHPNY17JWdPP4URvvQYB/snb/ 8N2iUUNJE3Kzz+1mV9d8kMdxrtf0ubHPujowM1L7/OjXuL9N5zjfbD3O2qicLjryXY7L clvFUz7v7TbdUsvHTpd6eepalzO5ha+3NlfBp7UHBYEpEVpR8K1A/IUHWWaWBEICXf9x F+4E5i8E7EWg0mxZHSiP1qHyiy8XbH1hcauTdW9yrxRbCWWLFbO+765obtH5l4NC0N/p UzTve8Kgp6Uifmbvg8qgI1o/LoC6uEKR8ph40LqX5cXQ7CTL/Q5PpQLGnqPxPifw4hJR BMpg== 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=hbXoP0vp+PirYvwWUgyHBe1Esfy/aJnIgbBAojigrF0=; b=VlK+djyyUS8kncfhtc+sQ+V68milBvAGsKQVkFfSLxJASj1k5IgbIZ+s7XOVj1cFkx hTh5u5nEyDk9rcNQkrtEMnbMvvtz9c515iO1K7AkSFGBaGoyjXD1ENVFr9FEW8XTHDPH zpZpJYYJ7jH1Dhm/132xOHd7vCFZ4tiJesbzDbecv0MKYhIqxrF0CVIalgXacEtqEdeV AXpSNgj7vQSWkkf7v8hjUz2UD0PQQgRWCQ6aF4s7AJDEK7oEAa9o2VujYp30jyTTGUmX 2GuehnoOHiVkgdHUXP4DXPKKS3V8Iy0KwfHoEsTOh+hMPnxoKIY5LRBWP/MxjsovnVM+ dwGQ== X-Gm-Message-State: APjAAAWvWNyDoV8JDywt4XY/O811ImfmQWl89DXh1VaQEGvBk9YK/eDz OhMHCaNyYQRYC8dqFRfn8YN3ag== X-Received: by 2002:a7b:cf12:: with SMTP id l18mr10187082wmg.66.1576756321641; Thu, 19 Dec 2019 03:52:01 -0800 (PST) Received: from localhost.localdomain (i16-les01-ntr-213-44-229-207.sfr.lns.abo.bbox.fr. [213.44.229.207]) by smtp.googlemail.com with ESMTPSA id k16sm6489660wru.0.2019.12.19.03.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 03:52:01 -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 v3 4/4] eeprom: at24: remove the write-protect pin support Date: Thu, 19 Dec 2019 12:51:41 +0100 Message-Id: <20191219115141.24653-5-ktouil@baylibre.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191219115141.24653-1-ktouil@baylibre.com> References: <20191219115141.24653-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 Reviewed-by: Linus Walleij --- 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 0681d5fdd538..8fce49a6d9cd 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