From patchwork Wed Feb 22 12:55:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 94321 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp926852obz; Wed, 22 Feb 2017 04:09:51 -0800 (PST) X-Received: by 10.200.41.13 with SMTP id y13mr28046200qty.154.1487765391476; Wed, 22 Feb 2017 04:09:51 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z201si713017qkz.244.2017.02.22.04.09.51; Wed, 22 Feb 2017 04:09:51 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1A51060D92; Wed, 22 Feb 2017 12:09:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 57FB960F51; Wed, 22 Feb 2017 11:59:33 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 778F961063; Wed, 22 Feb 2017 11:59:25 +0000 (UTC) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by lists.linaro.org (Postfix) with ESMTPS id 778C260E18 for ; Wed, 22 Feb 2017 11:57:35 +0000 (UTC) Received: by mail-lf0-f49.google.com with SMTP id b80so118320lfe.3 for ; Wed, 22 Feb 2017 03:57:35 -0800 (PST) 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=oL8ZSbiudAmtxOqMrdU01XDgLHKv8kFe/JgcYbSr3sk=; b=BlrFopW4fVMP1iReFFjeAVUZ4OQ/MU/IU07105S8sSGMPoSfWjhKGbcJdND7Mcd5yg ocS6lytuZBXg9+AmFyHtTKUsRZ//ta+obmf3hcYyr6hTfR6wTRPh9TWCpu1nIRxh+U3e cDD5VFA1V01AtIKLwwqwky9us19xYgYkX0JvYvetZ2h/BME9niQXYCCCusaLOQJ0irJV MHFn6NTUacU6B8kAAhvTqPnNvJf5V8sg8u05FBirpsxXD3wJAffDTH1JHWSRmnxmHbX0 jEDYqw/GDzVUs7Z0er/sjtR2McGf3rZY7JoeNo0fWLpDNxdmeJT2TGiNadmuRIhUGSC4 P32w== X-Gm-Message-State: AMke39koAFRs3AcAdr48WLyKs9pgFvYO8lGO4Ozdf0Syuf1p5YTtDJuFFBmMXaTCxYZ2GdkiDT0= X-Received: by 10.46.84.84 with SMTP id y20mr7600574ljd.126.1487764654420; Wed, 22 Feb 2017 03:57:34 -0800 (PST) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-76-66.cust.bredband2.com. [83.233.76.66]) by smtp.gmail.com with ESMTPSA id v21sm7035187ljd.9.2017.02.22.03.57.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Feb 2017 03:57:33 -0800 (PST) From: Christophe Milard To: mike.holmes@linaro.org, yi.he@linaro.org, forrest.shi@linaro.org, sachin.saxena@linaro.com, bill.fischofer@linaro.org, lng-odp@lists.linaro.org Date: Wed, 22 Feb 2017 13:55:58 +0100 Message-Id: <1487768164-43184-16-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487768164-43184-1-git-send-email-christophe.milard@linaro.org> References: <1487768164-43184-1-git-send-email-christophe.milard@linaro.org> Subject: [lng-odp] [API-NEXT PATCH 15/21] drv: adding driver remove function X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" The remove function, as for other driver items (such as enumeratos...) is called before the driver is to be removed, i.e. after all devices have been been unboud from the driver. remove() should release any resource held by the driver. Signed-off-by: Christophe Milard --- include/odp/drv/spec/driver.h | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.7.4 diff --git a/include/odp/drv/spec/driver.h b/include/odp/drv/spec/driver.h index 0b62c1b..221a6ce 100644 --- a/include/odp/drv/spec/driver.h +++ b/include/odp/drv/spec/driver.h @@ -336,6 +336,14 @@ struct odpdrv_driver_param_t { int (*unbind)(odpdrv_device_t dev, void (*callback)(odpdrv_device_t dev), uint32_t flags); + + /** remove function: + * remove any resource taken by the driver. Called when the driver + * itself is to be removed, i.e. after all devices are unbound + * Can be set to NULL if the driver has nothing to release. + * + */ + int (*remove)(void); }; /** The callback function must be called mmediately by the current ODP thread */