From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DA86C56202 for ; Tue, 24 Nov 2020 11:48:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0A552076B for ; Tue, 24 Nov 2020 11:48:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Uww3mbhq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732761AbgKXLsX (ORCPT ); Tue, 24 Nov 2020 06:48:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:42718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728491AbgKXLsX (ORCPT ); Tue, 24 Nov 2020 06:48:23 -0500 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B91772076B for ; Tue, 24 Nov 2020 11:48:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606218502; bh=VtHnWqVsQY2zwTyHbRZ7D1AiucgUkwK4eZw7+jkTLg0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Uww3mbhqruJFZvzQnbcVTBG7t1nlVZxO3f7zSx2YtSpPudoHpYNfo4iWcXlH+pI2P +Fv/gkpwgs0q4QTO6vQtbQWzvu6L4HnhnclPxRBD2KTM8U8FZDpJIIjhEO+Eza6AOz TUhMp/8wpsmMr1q0TgkHBhRP/mhkS3JbWb/EkH44= Received: by mail-oi1-f169.google.com with SMTP id f11so23487800oij.6 for ; Tue, 24 Nov 2020 03:48:21 -0800 (PST) X-Gm-Message-State: AOAM533FnE1i0tukQze9H5f5gH+vhSolRIkwDXnM7TNkAGMyTewpiCaI f32GQwrYcK4Y57c+xPaMm1wQHqhQYmdGCjbxiHs= X-Google-Smtp-Source: ABdhPJwSp4pxmPIGdITj7ZDZBjRjeX/NL61DDQ8fxoOGOexZQp+xCRkq/kBgmjEO7xED4YszByT1oSwHtw1foy0sZxM= X-Received: by 2002:aca:3c54:: with SMTP id j81mr2464381oia.11.1606218500976; Tue, 24 Nov 2020 03:48:20 -0800 (PST) MIME-Version: 1.0 References: <20201124103242.2971199-1-u.kleine-koenig@pengutronix.de> <20201124103242.2971199-3-u.kleine-koenig@pengutronix.de> In-Reply-To: <20201124103242.2971199-3-u.kleine-koenig@pengutronix.de> From: Arnd Bergmann Date: Tue, 24 Nov 2020 12:48:05 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 3/4] amba: Make the remove callback return void To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Cc: Russell King , Greg Kroah-Hartman , Arnd Bergmann , Linus Walleij , Ulf Hansson , Rob Herring , Sascha Hauer , Linux ARM , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 24, 2020 at 11:32 AM Uwe Kleine-K=C3=B6nig wrote: > > Most amba drivers return 0 in their remove callback. Together with the > driver core ignoring the return value anyhow, it doesn't make sense to > return a value here. > > So add a warning to the only driver that could return an error code and > change the remove prototype to return void, which makes it explicit that > returning an error value doesn't work as expected. This simplifies changi= ng > the core remove callback to return void, too. > > Signed-off-by: Uwe Kleine-K=C3=B6nig Makes sense, I checked that the vfio driver cannot actually return an error either, the 'if (vdev)' check seems to be done out of unnecessary caution, as the probe would never have succeeded if that was NULL. Arnd