Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp32466ybl; Tue, 7 Jan 2020 01:32:10 -0800 (PST) X-Google-Smtp-Source: APXvYqz8+y1v8CgLXs25F1b7QZLcZ4i0MmOTiHZJIk7BfgW/T+Sj4c4aUf6hYBnv6wKsdvc5K/n8 X-Received: by 2002:a05:6830:1bd5:: with SMTP id v21mr127719809ota.154.1578389530778; Tue, 07 Jan 2020 01:32:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578389530; cv=none; d=google.com; s=arc-20160816; b=w9UoQy+q8GXvWtyQ7CVmCP1b7rUxQkI+z+8NTaxzghHp4vFaSOXS+NCzQQe3tAK3e+ zFaJuepyi73+CAJBVkb1sl3XQbTzwwJ1hBgTO5zn/VJL19BTkHUUsWMMIutp0oMe89cf TYPaqNecyCu2ahWux7QMhwwKO3dzpiTJQy3wwjZhxXGPJ2oJJ5Jq4ATr1Ni+kz35TKrO kuA41BKSd8IlAwr/8Fh6BqYLNrCKHjjVwmX/5neqivn939K5qSNwi4IPfTIKVYvNFkKO P5U3uqG+DtdAftwG/fquGA7HZAjiHk/ITKjcdK2NieAIOrtKJGoalQpGQ3Z8pAiy10qC wskw== 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=zWSNoxkcez0eqw0Aps1ilr+VDBIlc30fQY0V5V4wZKdfF9/z6uuT2QI9SCNmdUqY2l oV5O+MqNjNDQ8edpIrBDI18qJY4/Tn51tojB6AA8GoRH4Cw32QeTCYBywcJw3nMhP8WF Y2Nc74Igr26CBOR1PWoCi/IPziUoTHEiM2c+M3NgtkJTog8woU2FsDHkzokxlNXf8TJb qF4/jKQPgUR/54NujvqwKqT6X8JK21VKyAmZ2xQfy0NS5ocip8gvoYsjT7ZQUGoKaw0Y NAFqZ5Zj+hT5/VqPOSQD6Vi7GVdmFvY4i61EZmuPIETVIvSbzQg2s4Ck3xk/t3aRpUDQ N65w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Nztzmz6e; 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 m25si37255162otn.208.2020.01.07.01.31.58; Tue, 07 Jan 2020 01:32:10 -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=Nztzmz6e; 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 S1727821AbgAGJaF (ORCPT + 99 others); Tue, 7 Jan 2020 04:30:05 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:53227 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727797AbgAGJaD (ORCPT ); Tue, 7 Jan 2020 04:30:03 -0500 Received: by mail-wm1-f68.google.com with SMTP id p9so18137612wmc.2 for ; Tue, 07 Jan 2020 01:30:01 -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=Nztzmz6eNrDSgwY251Ai+jCaKcgVlMtbs1husDeHVSovbnUMRq6BQy6T+FkRY85QUt IkPm2kc6gb4TKRKF9FcJrxc731QOVyMcGew3dD/tSBQKjAP+LRKZGh6aOooQaVKWp+Rg 6P2tqHM0gwsm5x60u/aaTllCnqHwav8cEdD0E7g9LTNfRzQZWXu1H3TEASKMczMBFKh/ R2ngRp/SMpSrOxjfH8STM4JpDVUIjGekw8rmweJQe1Jfy8YQdPaYt7hYZHkLWcIXtBgz fMR+HotI04mrMB8PYD19t+3Jyka0X9Daq1OE3DteC2aMDwpujEvYoAgBTrBi25T7g1kj Xxzg== 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=ACtxDHjRwNSEXudGQSXZbSdN61VTr0B7TnTquTVOg2/7E6IxUWyAhiqRKTrl444DjY 8tDUJ2jQ4sjVPDYVnVaVaWe5rQG83VfM3i+Jfrx7shuJGOefRUy9HxAVP0ejStmzfjVr bbcVMjfGMj6+ZZtvvegLQjtG6L64uxX3KtT2IJq/AE7DRAeq3mbTg51VrfmvKTmWAi4l ZX67VcnOr6jPFwIkSbTnqYO50A24JPY8s7fzlj0OO9ILwAHRl6YkJzX92bq0RPVv83e+ JtKr0HMXrPHBW2z2+WS9lwADpWgQt0J05lS+ZvGH5CxWb4C8B8XYJX9jjd9gIRgEgRdK 6pAA== X-Gm-Message-State: APjAAAX/4tRaUZAvW3wmo86mHfrkGRMmHZPM/DlxUDtoElBgONiccaa4 B5AiFqknse3GZYJMagRJMQ8wdg== X-Received: by 2002:a7b:c936:: with SMTP id h22mr37566162wml.115.1578389401133; Tue, 07 Jan 2020 01:30: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 x14sm25959969wmj.42.2020.01.07.01.30.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 01:30:00 -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 v4 5/5] eeprom: at24: remove the write-protect pin support Date: Tue, 7 Jan 2020 10:29:22 +0100 Message-Id: <20200107092922.18408-6-ktouil@baylibre.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200107092922.18408-1-ktouil@baylibre.com> References: <20200107092922.18408-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