From patchwork Fri Mar 23 08:12:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 889797 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 406xGq0j9Gz9s0q for ; Fri, 23 Mar 2018 19:17:23 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YjFBcRJs"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 406xGp6K1JzF21j for ; Fri, 23 Mar 2018 19:17:22 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YjFBcRJs"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::241; helo=mail-pl0-x241.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YjFBcRJs"; dkim-atps=neutral Received: from mail-pl0-x241.google.com (mail-pl0-x241.google.com [IPv6:2607:f8b0:400e:c01::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 406x964lYHzF20R for ; Fri, 23 Mar 2018 19:12:26 +1100 (AEDT) Received: by mail-pl0-x241.google.com with SMTP id n15-v6so7004382plp.12 for ; Fri, 23 Mar 2018 01:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pZCWi94tFBMlcsfsvdVxdI5gRTtgRYBtxNz9YTem+qc=; b=YjFBcRJsIx7LnAxVP5zyZ8pW9jY/zzq6Y799cPduS0NHXRFG2Rk2UudRDrJm1TJ1md QO1FTbbVJaaCHCNC8Sa/5RTCbmnXt6vNoRztx1hhknxavl0riADxTVzHQluSlIh+27yf GBShR4rElLn1DtzSD9ozwE+gRiBtyMBkjDNu/jpzCVqsOMAqFfJRTcndMhbE/lFAvUd/ c3wK/eSswLruq71XHlVNWBc3poykajs8MH1GhaHdidqcIvz0OhXFvQI/rqn0ous8cDm7 RINXjUknLi/z4reZJKe+HHeJCxR4x0Umm9YsVu9sP8OF5Oej+dDJDAJo0u3m78euYsJz SOQA== 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=pZCWi94tFBMlcsfsvdVxdI5gRTtgRYBtxNz9YTem+qc=; b=eVVlUU83MBapHy6h9GvsjMZdxScmD1tCl7UJP+mCeRuHJMIev5fD1Z76dfS5/F4LbY Ah0iZucKKm7sd+R4+UWOCQ6DWwtMH37Kl4CXgbO8k5Eg1ETgiIISQ8MO3n5XNcSZdFLZ MXRscldFl6fykjWo2YDfwDDuZ5C154Rwrzq4i95JwNJS2lJdQ5LPnwryfMhRKMGSFouV YFqLUDWRBR0fEPuGAOkkiDs8NSXGpqgw2KbxBjm9xikxjrdHdGjZ+agPatuQMcvEcrv4 0EQ+xhgWWUDmTje6n8kHxqz2sfotcdcb7FJceQDEaH6IT0uZXrEUOpmhXDkoU/lRalso V7qw== X-Gm-Message-State: AElRT7GfZ6+K8v2UDBQeh6cVqst1Nn/FRF9bUy6rnkyPwHK6Ukdi/Jb4 spK3sfCt0wEJB+hEomfCWDo= X-Google-Smtp-Source: AG47ELu7KlEMSFo3iaapzHqvTjDK030X1vT+9qJiohxy69/7Aab5Qqs1swx/OWeMbzdon5dan9rZrA== X-Received: by 2002:a17:902:a5c5:: with SMTP id t5-v6mr28794326plq.244.1521792744471; Fri, 23 Mar 2018 01:12:24 -0700 (PDT) Received: from localhost.localdomain ([203.220.205.233]) by smtp.gmail.com with ESMTPSA id q67sm7474808pfg.39.2018.03.23.01.12.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Mar 2018 01:12:23 -0700 (PDT) From: Oliver O'Halloran To: linux-nvdimm@lists.01.org Subject: [PATCH 2/6] libnvdimm: Add nd_region_destroy() Date: Fri, 23 Mar 2018 19:12:05 +1100 Message-Id: <20180323081209.31387-2-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180323081209.31387-1-oohall@gmail.com> References: <20180323081209.31387-1-oohall@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Oliver O'Halloran , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Currently there's no way to remove a region from and nvdimm_bus without tearing down the whole bus. This patch adds an API for removing a single region from the bus so that we can implement a sensible unbind operation for the of_nd_region platform driver. Signed-off-by: Oliver O'Halloran --- drivers/nvdimm/region_devs.c | 6 ++++++ include/linux/libnvdimm.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c index 2f1d5771100e..76f46fd1fae0 100644 --- a/drivers/nvdimm/region_devs.c +++ b/drivers/nvdimm/region_devs.c @@ -1039,6 +1039,12 @@ struct nd_region *nvdimm_blk_region_create(struct nvdimm_bus *nvdimm_bus, } EXPORT_SYMBOL_GPL(nvdimm_blk_region_create); +void nd_region_destroy(struct nd_region *region) +{ + nd_device_unregister(®ion->dev, ND_SYNC); +} +EXPORT_SYMBOL_GPL(nd_region_destroy); + struct nd_region *nvdimm_volatile_region_create(struct nvdimm_bus *nvdimm_bus, struct nd_region_desc *ndr_desc) { diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h index f61cb5050297..df21ca176e98 100644 --- a/include/linux/libnvdimm.h +++ b/include/linux/libnvdimm.h @@ -192,6 +192,7 @@ struct nd_region *nvdimm_blk_region_create(struct nvdimm_bus *nvdimm_bus, struct nd_region_desc *ndr_desc); struct nd_region *nvdimm_volatile_region_create(struct nvdimm_bus *nvdimm_bus, struct nd_region_desc *ndr_desc); +void nd_region_destroy(struct nd_region *region); void *nd_region_provider_data(struct nd_region *nd_region); void *nd_blk_region_provider_data(struct nd_blk_region *ndbr); void nd_blk_region_set_provider_data(struct nd_blk_region *ndbr, void *data);