Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3181614pxb; Mon, 1 Mar 2021 03:50:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOo6dAfPBcvvqmKRRS9iPqcsFCoWaPW+1FMDCS7XZh/b0shsGR9GdESdBWH99JnQZX2yB+ X-Received: by 2002:a17:907:d0b:: with SMTP id gn11mr15451066ejc.144.1614599430945; Mon, 01 Mar 2021 03:50:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614599430; cv=none; d=google.com; s=arc-20160816; b=TazkQkWcXXxB/erO49BWXbcvBM4wAL5SYtdrONVSMDTuj770nkXSP/2r0a5+MIIcwu mW02mbOTR4hqAxtwCApXLCRRN6NdVje+7JLGgLgsDjhmGFMOtQB1L346Pz0NEnmuA4Ad 6mm3rscVMFj/xjE3o4o6UdZMwASRxenUMLj3+HCzKSpP2vW0EUEWsBqTkftJczUJLW6O FPqQzZIjk8GU19v4rOV9UNcyQWEfWli/s+QODtPB3IylqYludLFnz+75cuQqfgmWdLWT hfQJy7CMaAImkMHIgmPDYG92ymG8gDwqoo4dDN9KFjJnp0BOcGAtnLOu1pQwmn53bUfA FK4w== 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=mlNfhmRXyGY5apY2DaaUQmX/F3U8hMSl9F2BgzSjgAE=; b=WwxYJ+yZp5MbMSBUt9npgr+9kcqoODppXvsnWbCRKmwgvD+F867Em6vIukT7VbaPSi xVAFSx2WNqj9Y+l4Um8yE7ywZFUpjwfglUErfBFWk1cowi0crbao40wHqijQ5mYo1Tg8 iIFK1iHbAx4LAEt7rZg836Y85JRGNnEULC23OUAhfBSPBKLkd8xvcVOt5vX2SYI5tFX6 0BQDqLJYPkxeF9Y+YGHm98VYdadZubFZ3NAjLUAXe3HtNIDw6rd5gJXLxvCXUEA+WooG nNFbfa8xZhfqlOR0qreP/0zY93FE95oXAKuYaAhmQqiEjSR3xfaOz2LCzKX9IISYN2wH KuqA== 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 kl24si12009116ejc.100.2021.03.01.03.49.55; Mon, 01 Mar 2021 03:50:30 -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 S234180AbhCALrw (ORCPT + 99 others); Mon, 1 Mar 2021 06:47:52 -0500 Received: from mga04.intel.com ([192.55.52.120]:54863 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233740AbhCALrm (ORCPT ); Mon, 1 Mar 2021 06:47:42 -0500 IronPort-SDR: qlNWS0oKCRMWD43KYmirCrUXq8wuQiV7QS2ur6BF5rk+P6fKPBG+7nhi/niUXEpAAnySU/1CTI W1snxK8lEQ4A== X-IronPort-AV: E=McAfee;i="6000,8403,9909"; a="183993225" X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="183993225" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 03:45:55 -0800 IronPort-SDR: +qsS9ziWSi/M4gUtKn77TpHPPy2eHBU/uQJPUaJt9R21JbMKH/S1540cAJSatP+XSDdKl5wfKH dNAgEygDqsLA== X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="397689816" Received: from gna-dev.igk.intel.com (HELO localhost) ([10.102.80.34]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 03:45:53 -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> <85a6rnjgys.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 12:45:51 +0100 Message-ID: <857dmrjdw0.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: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. > ok