Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3556626pxb; Sun, 7 Feb 2021 13:59:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKQEn/RPfMJbuec63J6Pt6/tPX9tigDso9It/bpczonRlFzG90s+lb+AH8F/i+HwGseoLL X-Received: by 2002:a05:6402:2683:: with SMTP id w3mr14229312edd.378.1612735194182; Sun, 07 Feb 2021 13:59:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612735194; cv=none; d=google.com; s=arc-20160816; b=RyTKbMwLwiszS5Zp5iuyRL9M2XMEPD2yVnSMFFCJ7+BqfHJYs3sttsn2BBXvTnv1f8 GBDseTky/2WCRJ/LtzSGBWLLl40zpc6PfOj4tHxQ2/tXhkgrX73Nc7gDERq/mfKGppcK jLq3ttuGqCijEYu51Rb47ZOEvlVANwbPVeBD31NVMERkqY/X6dExJ40Pe6s+fBWZu6N1 qj1EC+Ojwd56+H8/Cd9hkBTo+av9FtpIMyOsKyz0cGkYso2QXguijFvh+b8B2QetqlOV 2gJ+bZSxoTCS0oM6NudpJVU8WPYdBUU+aHMjPZu35JXmLAh95omw/j/nIacHXAGUyLv/ qnZQ== 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 :message-id:date:subject:cc:to:from; bh=pgTQqOcqWpybRt982iGgq7RwYmnhX1Xv11HvELVH2EI=; b=h0KaerX1lrTp2ILwH0kkIcaDJ/F97ihkPB6jtUq7E1GiD9PZ9BlcktgItZvdaaV2I0 r7URBjLpt4xuTPv9zqzkzTlxeUemDaJTif7pm1xyhEIg81ivTk+ZpJyc1vrNepVoEbQT 1n+lziuyHjbikxDKWz1u8P23bXg0aeKpzE7e0cC8Q2qELjibVDgGCE/XsuCGKHoFWlGl 40UPs9+dHWGquSLeJrhtGxfqul1jG17COf0VCFO4grZzxUkczTtdxNKiq7pRcB43fB/Z PhZIrmVpvnDmalPJdC+svjjhjMNLUBET5sQ5e29KEYnfuDO9zx5+cdTDCB9IynZfWpoH szlw== 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 t22si1708965ejf.399.2021.02.07.13.59.30; Sun, 07 Feb 2021 13:59:54 -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 S229692AbhBGV5g (ORCPT + 99 others); Sun, 7 Feb 2021 16:57:36 -0500 Received: from antares.kleine-koenig.org ([94.130.110.236]:47654 "EHLO antares.kleine-koenig.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbhBGV5d (ORCPT ); Sun, 7 Feb 2021 16:57:33 -0500 Received: by antares.kleine-koenig.org (Postfix, from userid 1000) id 48246AF2E92; 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 1/2] ipack: Fail earlier for drivers without probe function Date: Sun, 7 Feb 2021 22:55:55 +0100 Message-Id: <20210207215556.96371-1-uwe@kleine-koenig.org> X-Mailer: git-send-email 2.29.2 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 without a probe function isn't useful as it can never be used. Let registering such a driver fail already instead of failing every binding. This is only cosmetic as there is no ipack driver without a probe function. Signed-off-by: Uwe Kleine-König --- drivers/ipack/ipack.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c index 9267a85fee18..eabc4d08792a 100644 --- a/drivers/ipack/ipack.c +++ b/drivers/ipack/ipack.c @@ -64,9 +64,6 @@ static int ipack_bus_probe(struct device *device) struct ipack_device *dev = to_ipack_dev(device); struct ipack_driver *drv = to_ipack_driver(device->driver); - if (!drv->ops->probe) - return -EINVAL; - return drv->ops->probe(dev); } @@ -252,6 +249,9 @@ EXPORT_SYMBOL_GPL(ipack_bus_unregister); int ipack_driver_register(struct ipack_driver *edrv, struct module *owner, const char *name) { + if (!edrv->ops->probe) + return -EINVAL; + edrv->driver.owner = owner; edrv->driver.name = name; edrv->driver.bus = &ipack_bus_type; base-commit: 5c8fe583cce542aa0b84adc939ce85293de36e5e -- 2.29.2