Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp41147pxb; Tue, 2 Mar 2021 18:24:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzT/I6ZnCBH9zqmMHmBQeQ0ly9X8ofEXAqh7nUQP/qyCOg50B4IwCEm+0rHA1bBmm5LikV2 X-Received: by 2002:a17:906:1352:: with SMTP id x18mr12951137ejb.545.1614738257943; Tue, 02 Mar 2021 18:24:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614738257; cv=none; d=google.com; s=arc-20160816; b=JntYGUvCMUDJZYAothZYYpH1Uj32kLAfdOOmpr6KavelNr9WPB8TU3U6RegaEYqwuo p6ZURZuso4MC7Prw7/QNDKdNdsJLxefzod62MXNj3Yqqnv96z2GOkAyUNz6gIMSuqV8o +JdQOLtEUZGGAFdSyx0K9szAsiHRvSSKrK6t+71xAUYM/ZOX1PqUZpI1Q1RbzT9xeblL ucVvjlnVFECRSThw3h2aRgSQuCmwldZ8kjjXZp9KNRaLyir6VuJ5F+oUXr71m92Z2dOl A4hKIi8BlEU2ixWAzLezqdkjSjMPafxTgGIBXxUi5SDd/XKmRq4YKHlVso3MeP1G+eZl xwsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wZ9exDrpF6etEYKkDBnK0jiJAmZKnKj/m3Mj/VqwMGM=; b=GQUwsV9jmMI3yh5VAH0TqfoiTHtpkMGCSXot3r5qhEe9tZIlWU0FEMGzcktKvc/phE 0O6QlJ3h3dJ/kmP/jJMFMF9M7ZAC/txNmMxcQ2UPHgT8rJQHsqB2nSkw4sgMhTdFKFrk +MR5X1j997c0eUuQO0jvm3lWjjUu7XIky3b0tKVfIfDZTUdubNPxx9AqbHlTR4M+k2E2 0PjqcnMoqmr+k6FOZLNSZxKHswYfS0a+HV+Pl/lpyCecqkYhWP1detPgGyn8GNy1msvS jmNQgMyR3zYaEBVdbiXRUDL7FPg8iluJ9MwUZAtzG7krWA8egG7V/6EHSq0ON0vfUyHX SGsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HvCnCWIv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qo14si407010ejb.675.2021.03.02.18.23.55; Tue, 02 Mar 2021 18:24:17 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HvCnCWIv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234446AbhCAKrN (ORCPT + 99 others); Mon, 1 Mar 2021 05:47:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:38744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234655AbhCAKqu (ORCPT ); Mon, 1 Mar 2021 05:46:50 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 36DA664DB2; Mon, 1 Mar 2021 10:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614595569; bh=HXw4HIPStfhGkLrnF2qRO0EDkKdkyxdus6C11B++ZeY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HvCnCWIv0qBLLsPtph+iQ5qZOzuWRXTUvnJ0lEYbBQhgHV0MCeX7JYUHDSk+khZY6 9HaVmUgs5pltmAROF8lTYunXVqj8ismHvdSVzfDqSJv7JPYBMVAS9KjJAbKP2WJ6ZX RwiWpvPnGRN/eexHOW5AA5Bnt7Z+/l0bfRx+I1z0= Date: Mon, 1 Mar 2021 11:46:06 +0100 From: Greg Kroah-Hartman To: Maciej Kwapulinski Cc: Andy Shevchenko , Arnd Bergmann , Jonathan Corbet , Derek Kiernan , Dragan Cvetic , Linux Kernel Mailing List , Linux Documentation List , Tomasz Jankowski , Savo Novakovic , Jianxun Zhang Subject: Re: [PATCH v1 01/12] gna: add driver module Message-ID: References: <20210216160525.5028-1-maciej.kwapulinski@linux.intel.com> <20210216160525.5028-2-maciej.kwapulinski@linux.intel.com> <85ft1fjhws.fsf@linux.intel.com> <85czwjjh3b.fsf@linux.intel.com> <85a6rnjgys.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <85a6rnjgys.fsf@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 01, 2021 at 11:39:23AM +0100, Maciej Kwapulinski wrote: > > Maciej Kwapulinski writes: > > > Greg Kroah-Hartman writes: > > > >> On Mon, Mar 01, 2021 at 11:18:59AM +0100, Maciej Kwapulinski wrote: > >>> > >>> Andy Shevchenko writes: > >>> > >>> > On Tue, Feb 16, 2021 at 6:11 PM Maciej Kwapulinski > >>> > wrote: > >>> >> > >>> .... > >>> >> +static int __init gna_drv_init(void) > >>> >> +{ > >>> >> + int ret; > >>> >> + > >>> >> + mutex_init(&gna_drv_priv.lock); > >>> >> + > >>> >> + gna_class = class_create(THIS_MODULE, "gna"); > >>> >> + if (IS_ERR(gna_class)) { > >>> >> + pr_err("class device create failed\n"); > >>> >> + return PTR_ERR(gna_class); > >>> >> + } > >>> >> + gna_class->devnode = gna_devnode; > >>> >> + > >>> >> + ret = pci_register_driver(&gna_driver); > >>> > > >>> > Is it possible to decouple a PCI glue driver from the class as many > >>> > other existing examples are doing? > >>> > > >>> > >>> I see many pci drivers (including staging) that do have it glued though. > >>> > >>> Examples are: > >>> 1. "static int __init kp2000_pcie_init(void)" (commit on May 20 09:34:11 > >>> 2019) > >>> 2. "static int __init hl_init(void)" (commit on Mon Feb 18 09:46:43 2019) > >>> > >>> Please give me more details. > >> > >> Never use a staging driver for any type of example, _EXECPT_ for a bad > >> one. There's a reason the code is in staging and not in the "real" part > >> of the kernel. > > > > ok. > > > > another one (1) is not staging.. > > I meant "static int __init hl_init(void)" is not staging one.... Still doesn't mean it is a good thing to do. Again, why isn't this driver just using the misc driver interface instead? It's much simpler to use and should work just fine for this tiny driver, instead of having to create a custom class just for it. thanks, greg k-h