Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3142769pxb; Mon, 1 Mar 2021 02:43:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJy+AOzEgNUN+W4FS6Fbo76cYFv5SsE8n+qgEzjZ2o2dDpH+yRlghMnuu1B3cvKZIRqGimcH X-Received: by 2002:a17:906:4e17:: with SMTP id z23mr13769074eju.439.1614595428553; Mon, 01 Mar 2021 02:43:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614595428; cv=none; d=google.com; s=arc-20160816; b=DzI+5ywZyVpuZNyoX8A3hNrlxkVSUHkUbwkQGWjID3v0RnJzrg4vowdCqTZNjOdIm9 yGpP15Vo7wLm4tw9aOH9AsAjXUWdcIQ/HfO+dXc8OuqfIvkv04Gc99jJs+xMXcu0T795 lFtkeAPK2rLz70XDJwXPHOodooQd/DM0NYScZFJdg1gpgjdVFAU8uKB8YEexiG3aegnH Jt4vunyyOUokXVOWv3+wsJPPwqk4nYiyfdzkt0uBNXfrqH4y8bkj5rF45XJVMpz3nkuz HszKXythG7pvceNRW/U9HfQjncpuycTijCFhIQDmofZN17L/qUGlqHJyHKZl+/lLYN2H Zu+Q== 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=MtrwYi9e3OFTcI7XN35//7oRQnFygEJc8AcJgbBfDVg=; b=Dhb4a/CbSbloPLfFCuSg93rBtIlcTwUib7uLNVcPfuC5VU8IksSA6ImlSlNM3+2n+w rM7RsHfnIjrGpYvbgZ0lg0zKfSxB1FbU1J9GZeU7LLwSA+/9m80MKevtuLPDw5aKu4gp F9dVDcw7+/rvpy8MIMlvFUhfvNPDCzFoEoCbe34Lk6fbg+5ZR337IvJ6YFqDUYyEPsvQ ULbcYdtmnfZQ1fmH69UlutHtjL82i/yp1X5N/akB91njaTyJ0v9d6E05HJMGiaU38JNQ Md5Ft2t0u3024pxaUPVTzxmoVjJURTxHVTi1cigOYDAw+j4jPz0LM44ABumtQS7Opl09 OfmQ== 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 s21si6087839ejz.688.2021.03.01.02.43.25; Mon, 01 Mar 2021 02:43:48 -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 S234626AbhCAKlC (ORCPT + 99 others); Mon, 1 Mar 2021 05:41:02 -0500 Received: from mga01.intel.com ([192.55.52.88]:30058 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234606AbhCAKib (ORCPT ); Mon, 1 Mar 2021 05:38:31 -0500 IronPort-SDR: fk5kOmRKRTwaBC8fX2U9bnclwt99r/R6N4t4xtSg0vzdA8CMfPhEWHiiZ0xpOEFI6caU2HXe/8 gIRXtCXetDYg== X-IronPort-AV: E=McAfee;i="6000,8403,9909"; a="206026612" X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="206026612" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 02:36:45 -0800 IronPort-SDR: 4Ic0AvbGoMFVDN83zbyg91KXTaFhUAvBKkobvKwwrg7oQiljIpGcNd6CJEfKGDbrFwIzwODY76 oEWe3tq34KOw== X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="383003039" Received: from gna-dev.igk.intel.com (HELO localhost) ([10.102.80.34]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 02:36:43 -0800 References: <20210216160525.5028-1-maciej.kwapulinski@linux.intel.com> <20210216160525.5028-2-maciej.kwapulinski@linux.intel.com> <85ft1fjhws.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: Date: Mon, 01 Mar 2021 11:36:40 +0100 Message-ID: <85czwjjh3b.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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..