Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3143564pxb; Mon, 1 Mar 2021 02:45:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2EWGrOyxHJVnaJwzZoT8Pg5rsenxFJBu/h5/xP1sLnF6g3qQ6AsZ00zn7cnXhswr+nvXG X-Received: by 2002:a17:906:3750:: with SMTP id e16mr12305576ejc.75.1614595518903; Mon, 01 Mar 2021 02:45:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614595518; cv=none; d=google.com; s=arc-20160816; b=BoUxNv66kgG5nd4PWzk/xMUglI37FWCKetW4N/qv3rbGma/HR0ypajOixTL6aHYYgJ aW378Q5DOYxZv1tzGJAz0MgABPS5/YahzArtIsAI60JuHyIABzHSPiksieHGELkbehIA QQ9LUu8cim2IPPSFWTPnLHgIO48MgjzzErJa0v0ER+IvAAYOzQFNWkHk+v/UlOgQvyBa 2F2YRN73oVrF3CTUXCShHoEqWesgO0JMj2rh+kUmXOzPju/qEolQMmuwN6U3yRn4+r2V em8CW12JSNVoHbRo4O+XmkK1ZWa0NrZ02y7xsYLFIugJ0kfEkQCcFPXWwsOaVxZt3Ekg Jtkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:from:user-agent:references:ironport-sdr:ironport-sdr; bh=6YiPu7LuB+5ePbK8dSgwSgDOTMdfWtDdQ8sYESWqUII=; b=yJzRMOBg4+x/Q+eRaAKhJth20TgDODV6cCAGpy50tcxNFR0RfrFU8vXKtFiKpKTqbB ZIfHus1FsiDOr1tFtzUWb+0TUf4S172ds+xpSf/52CS25rgJFStB6qrT0KYas6Ln5PR8 g3an2G6T4Xwf3chjOdUpgZGYs6O68msVsg3vqkhEGp2b3Bz+mamoohwp0LbOEM1AIvaX n8PJ/oZ+NDke+hhvvRHqbLA9d33hyqa9JM/dsWooGwpE9g6XhVj/KKVo5lBGAZVlx2WP wiEadtrvAJ8vbaiaQAqCFaa/UWms/8/WIIzsEel4pa8VdRbvN2QobKRUowVaol3cNZzs /C6A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y21si10633763ejp.340.2021.03.01.02.44.56; Mon, 01 Mar 2021 02:45:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234581AbhCAKmH (ORCPT + 99 others); Mon, 1 Mar 2021 05:42:07 -0500 Received: from mga02.intel.com ([134.134.136.20]:40724 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234628AbhCAKlN (ORCPT ); Mon, 1 Mar 2021 05:41:13 -0500 IronPort-SDR: Voar9rS4Y1lFwKGwtUL8Jq19FElQpDCE/rvPdzggvso5+NXpkfqr+TS7Kx48dCXH3Zfty3BC0a 31GPgbV/Wgdg== X-IronPort-AV: E=McAfee;i="6000,8403,9909"; a="173553342" X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="173553342" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 02:39:27 -0800 IronPort-SDR: yPwqVElsZe8iQCA5iJ+kwDO4Y9NYP0m+r547zvuxwLazlQqTcP5Drdi8Y3sbWR61aw6hqxoo4A C44Qx8pUmzsw== X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="504923472" Received: from gna-dev.igk.intel.com (HELO localhost) ([10.102.80.34]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 02:39:25 -0800 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> User-agent: mu4e 1.4.13; emacs 26.3 From: Maciej Kwapulinski To: Greg Kroah-Hartman 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 In-reply-to: <85czwjjh3b.fsf@linux.intel.com> Date: Mon, 01 Mar 2021 11:39:23 +0100 Message-ID: <85a6rnjgys.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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....