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=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 00C08C433E0 for ; Mon, 1 Mar 2021 10:47:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B563D64E66 for ; Mon, 1 Mar 2021 10:47:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234659AbhCAKr3 (ORCPT ); Mon, 1 Mar 2021 05:47:29 -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