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 7D2F3C433E6 for ; Mon, 1 Mar 2021 10:26:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 402C564E6B for ; Mon, 1 Mar 2021 10:26:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233449AbhCAKZo (ORCPT ); Mon, 1 Mar 2021 05:25:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:60238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232598AbhCAKXL (ORCPT ); Mon, 1 Mar 2021 05:23:11 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C50DE64E13; Mon, 1 Mar 2021 10:22:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614594150; bh=cXpAgN4LikCvbKoWKcp8iBPz7XpWuUo9aOcmE7Nu8Ps=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E2oUweW1E1knpm3/rH0BBQEGcc5mipD7kWYJOFPI7F5JCyW9+zVLQrrbZLHQu2VB2 B7Pd6M8wqL2IR70lVqSL9Bdpyz+yJO798HbX6G/4QX+DDSFvXzaVlUCzMx0yhz2dy7 4zOFwzwCvruIO5kbi8S5xCDZszIrHyuT3h5rPK1o= Date: Mon, 1 Mar 2021 11:22:27 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <85ft1fjhws.fsf@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. thanks, greg k-h