Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4801055ybv; Mon, 17 Feb 2020 06:15:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyX7/GbFnlSnr47nPrgYbpFqqQQuwz+7k6E063IB29LmDCtGZoyk0KenquRXXESu7o+v18t X-Received: by 2002:a05:6830:1691:: with SMTP id k17mr12669919otr.282.1581948923201; Mon, 17 Feb 2020 06:15:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581948923; cv=none; d=google.com; s=arc-20160816; b=B6al1dBSGSOYE3sF/Cytx89P5LMuSigqsFU1LdhKoe5lD16zVVc0bkqXoppaoTVbr+ lps2TzBRU04SKKDC0in4Ld15pGcEneFl/Cp19JR6vvKa/J46JJ52siuJME2PHL0srkRi sSfsZRvfchN2AayU5BgomSH99u0IqcspYsOgmUObSM+1mkhtNTzAelyNyxF/sJNtlNTl at4IXvplcAaW1BNnYFHMLZMFJALgINFn8UTcSFHnVnr9A0IC8zGkwjo0YlzRW/bJYPIo efWlgD8mZyLDUwJvT8zRvn160wzwow/qlLPGc5jntbr9Fqh1Mcp3n+fsAlk0FznJxgPE hr6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=PI0LvpGjO/OZvCQU1PxswC2EPMei884/nsAkhdkaeP8=; b=houoUpJmm5i6/2FGJceVPCG9hdm1CCwnLrYc4hik7RhzFHeZGb4hWjmLPkCzJtFjj+ gyYgwE2ePfbrEIbDUUcQtCg6yUgGDmSIpualwpNjGs3gCGyVGYTAi9nTe1dYREw31N2X qODMFSdTxcDVwPuuppuFmo1+1xehqXnWplTKBPhQ/Izz+N8AmFOMJFOx3Nx4SxGhhzGx +BVQKgiRZjVZHossRDaQ+KNW4O7Jhwsy8JGaQ/AsOZzbXo+rkuBwRNLXKm01PV1kuC/0 q5VdXmDR/Kt2bvUZeG/Zf5KlMxIx+eaDWo0WEdvPJW0ZYPdkN12NIYOwvXRiMVoNti/2 NtVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=w5VjHmzv; 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 8si6485823oix.109.2020.02.17.06.15.11; Mon, 17 Feb 2020 06:15:23 -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=w5VjHmzv; 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 S1728768AbgBQNx1 (ORCPT + 99 others); Mon, 17 Feb 2020 08:53:27 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52982 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727448AbgBQNx0 (ORCPT ); Mon, 17 Feb 2020 08:53:26 -0500 Received: by mail-wm1-f65.google.com with SMTP id p9so17235079wmc.2 for ; Mon, 17 Feb 2020 05:53:26 -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; bh=PI0LvpGjO/OZvCQU1PxswC2EPMei884/nsAkhdkaeP8=; b=w5VjHmzvIVp/HsTMrnc9z5s2CtLUjUztbi2kHK96i4oWzwnIcHTP+GtIBtBQuzpl9Z cHu9MWaFp5qHlb8kvQ4/DWJEH5/ae4IjXLtSOQ4d3aWf6XlAHs7VZCA/X1WGMKrxRIke C/2tHs+TtOyiPtB6ebp9jT2B4ob1Qzc16UUd75HXx5cW5XhDZ5F/y+0lieIgjHAYu6tT bGoFdaetxAV2vCp7/kz3sVG+/nurOi1uhP2inSsg76f5uw7QT0Aoy+iDHkbOGMi6dpgS 7dmtKchlMlSX2v0/4oS5hqVVSNLwOYUsHlLB0R8Pp6lVxQpiEVTTl9UNhE0eyZbWVYRE dbew== 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; bh=PI0LvpGjO/OZvCQU1PxswC2EPMei884/nsAkhdkaeP8=; b=dkqiNjrOsFx6HJQAIZnl3sGyKC6tySeMuET4pC49pGWNScfo4jzJelDhMAxRuQVyWG WbqnuyqOG6gd+ivH17SJ96yLAY9zTyqlEXlYk0WAuGgwSZY/Myka5yU7Ak8J6RcPbTT2 3kGY0C1XmyzxXaUToMhc4QqxuyAGQZ7Cm3myV3+nZioNlwcWd9IQz79rZccTaFJmm1Rj vvgQuTqT1H7cslDv581pQ1TpYkcQxHzg+MA6M6kZRf/ibuHBptqQHqFNfk4wwM3gbixX XV6QRW7NJtSgC1F6NUyuUuqa/zPZZBUeG2omKb2iXLxqKc+Da9YyWUgCLaVwA8gQ32p4 wLTA== X-Gm-Message-State: APjAAAWlrOZRXSlxGqjKmCSiqEz1qBGpb+Z8wdhJIQJJ50RhRfgYVwld wAdtyGSJ1B49bdRExiTvZKabbA== X-Received: by 2002:a7b:cbc9:: with SMTP id n9mr22664934wmi.89.1581947605445; Mon, 17 Feb 2020 05:53:25 -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 o4sm1131010wrx.25.2020.02.17.05.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 05:53:25 -0800 (PST) From: Khouloud Touil To: srinivas.kandagatla@linaro.org, bgolaszewski@baylibre.com Cc: linus.walleij@linaro.org, linux-kernel@vger.kernel.org, geert@linux-m68k.org, baylibre-upstreaming@groups.io, Khouloud Touil Subject: [PATCH] nvmem: release the write-protect pin Date: Mon, 17 Feb 2020 14:52:45 +0100 Message-Id: <20200217135245.29195-1-ktouil@baylibre.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implement the auto-release of the write-protect pin that when the registration fails, it's auto-released. Fixes: 2a127da461a9 ("nvmem: add support for the write-protect pin") Reported-by: geert@linux-m68k.org Signed-off-by: Khouloud Touil --- drivers/nvmem/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index ef326f243f36..5f1988498d75 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -72,6 +72,7 @@ static void nvmem_release(struct device *dev) struct nvmem_device *nvmem = to_nvmem_device(dev); ida_simple_remove(&nvmem_ida, nvmem->id); + gpiod_put(nvmem->wp_gpio); kfree(nvmem); } -- 2.17.1