Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3557210pxb; Sun, 7 Feb 2021 14:01:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFSU/WhbIkoWlCuvzquodHOJLVmS6stisOJKuZab91R3p/y9RASWFm/j/Dq5y96DNl0wd8 X-Received: by 2002:aa7:c58f:: with SMTP id g15mr7142319edq.383.1612735265192; Sun, 07 Feb 2021 14:01:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612735265; cv=none; d=google.com; s=arc-20160816; b=K946HAuCX00+9wwg9kdAi8I/EyP9Y7SOINkQ6sEUvsFL6iJ03jyahdQWuJyrxvtmGI 8ndvoUmchiDEbay7eORiWoOCHznX1iUFjEkQ+t+UhBxIzxb5axhC+cs7rH8pc4stGonl WFb8M7m/dN1HRyyzCCC03QvGaJf0W3wt046svJnCOQFnrFeMV06/p5cW/LLmzXJZW8Lx ElR/RIV/8tEnMOr3JF3y3XZUwVXsL2ZK343JkjhiKwHNoI2w9NQ7xZY51OvhsSvbnZLg sl9+iDZriLdlyteH6z7UXSjOMZgVLKwPoGzfIlNdvlCjUzwD3YeSnWJx1cHtdQb0ai8U tULQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/55T/HNs+sr07Yb6W7N33ttozim1Ji7ckR9QSMgsz8w=; b=LLtUrVfjk8OLZEDzu/0lT+kqSAMVXYQEOosd7zQOfCKoZOoqQl6EH6014WWSfWD/3o jyQ9W4yfR3EWzQAWNPZqr7pzp0F7Gmxq4CpVf6+x0Gyqf9h30xZqhxchJguR7eq3xfR1 1LR/nR0m5YMd4c6x3NiDc1ldv64Wx+rK83mCqxPAMLJ3faElpMD5SwSwLR4t6KcfXhqM BlAg1X8AEiWHHkAGwBVJtXtzHjD9FA3hvjQlUVeCtbROQ8+xg6Mp3GUak+YjaRaMNw/z EpgY8dU+hVhjE4J34c0l9bNN+O4OeR5rtqqWkgMuYdpmMbVewBJyuCXycNN/lAXYkkZH pxsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l13si14481043edn.5.2021.02.07.14.00.40; Sun, 07 Feb 2021 14:01:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229650AbhBGV5e (ORCPT + 99 others); Sun, 7 Feb 2021 16:57:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbhBGV5d (ORCPT ); Sun, 7 Feb 2021 16:57:33 -0500 Received: from antares.kleine-koenig.org (antares.kleine-koenig.org [IPv6:2a01:4f8:c0c:3a97::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07620C06174A for ; Sun, 7 Feb 2021 13:56:52 -0800 (PST) Received: by antares.kleine-koenig.org (Postfix, from userid 1000) id 70220AF2E94; Sun, 7 Feb 2021 22:56:51 +0100 (CET) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Samuel Iglesias Gonsalvez , Jens Taprogge , Greg Kroah-Hartman Cc: industrypack-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH v1 2/2] ipack: Handle a driver without remove callback Date: Sun, 7 Feb 2021 22:55:56 +0100 Message-Id: <20210207215556.96371-2-uwe@kleine-koenig.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210207215556.96371-1-uwe@kleine-koenig.org> References: <20210207215556.96371-1-uwe@kleine-koenig.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A driver that only consumes devm-managed resources might well have no remove callback. Additionally given that the device core ignores the return value of ipack_bus_remove() stop returning an error code. Signed-off-by: Uwe Kleine-König --- drivers/ipack/ipack.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c index eabc4d08792a..7de9605cac4f 100644 --- a/drivers/ipack/ipack.c +++ b/drivers/ipack/ipack.c @@ -72,10 +72,9 @@ static int ipack_bus_remove(struct device *device) struct ipack_device *dev = to_ipack_dev(device); struct ipack_driver *drv = to_ipack_driver(device->driver); - if (!drv->ops->remove) - return -EINVAL; + if (drv->ops->remove) + drv->ops->remove(dev); - drv->ops->remove(dev); return 0; } -- 2.29.2