linux-cxl.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Ben Widawsky <ben.widawsky@intel.com>
Cc: linux-cxl@vger.kernel.org,
	Alison Schofield <alison.schofield@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Vishal Verma <vishal.l.verma@intel.com>
Subject: Re: [PATCH 4/6] cxl/mem: Move character device region creation
Date: Wed, 28 Jul 2021 15:34:27 -0700	[thread overview]
Message-ID: <CAPcyv4ivzCJ=6OU2CcWB0ZuVkyK18g8KuBysc6cNjsmDf1nrzg@mail.gmail.com> (raw)
In-Reply-To: <20210715194125.898305-5-ben.widawsky@intel.com>

On Thu, Jul 15, 2021 at 12:41 PM Ben Widawsky <ben.widawsky@intel.com> wrote:
>
> In order to merge the memdev specific functionality of cxl_pci into
> core, the character device creation currently handled by cxl_pci need to
> be moved. The rest of the changes are largely cut/paste, the actual
> functional change is done here in preparation.
>
> Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
> ---
>  drivers/cxl/core/bus.c | 12 ++++++++++++
>  drivers/cxl/mem.h      |  2 ++
>  drivers/cxl/pci.c      | 14 +-------------
>  3 files changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/cxl/core/bus.c b/drivers/cxl/core/bus.c
> index 33196813ebcb..8c2351c52d2b 100644
> --- a/drivers/cxl/core/bus.c
> +++ b/drivers/cxl/core/bus.c
> @@ -22,6 +22,8 @@
>   * instantiated by the core.
>   */
>
> +int cxl_mem_major;
> +EXPORT_SYMBOL_GPL(cxl_mem_major);

This symbol export is necessary here, but it's not needed by the end
of the series which leads me to question this fine grained split. I
think the shutdown patch is suitable to split, but this one and the
last can be squashed.

>  static DEFINE_IDA(cxl_port_ida);
>
>  static ssize_t devtype_show(struct device *dev, struct device_attribute *attr,
> @@ -632,12 +634,22 @@ EXPORT_SYMBOL_GPL(cxl_bus_type);
>
>  static __init int cxl_core_init(void)
>  {
> +       dev_t devt;
> +       int rc;
> +
> +       rc = alloc_chrdev_region(&devt, 0, CXL_MEM_MAX_DEVS, "cxl");
> +       if (rc)
> +               return rc;
> +
> +       cxl_mem_major = MAJOR(devt);

I'd rather have cxl_core_{init,exit}() call something like
cxl_memdev_{init,exit}() that way cxl_mem_major can become static
again.

  reply	other threads:[~2021-07-28 22:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 19:41 [PATCH 0/6] CXL core reorganization Ben Widawsky
2021-07-15 19:41 ` [PATCH 1/6] cxl: Move cxl_core to new directory Ben Widawsky
2021-07-15 22:44   ` Dan Williams
2021-07-20 18:07     ` [PATCH v2 " Ben Widawsky
2021-07-20 18:14       ` Ben Widawsky
2021-07-15 19:41 ` [PATCH 2/6] cxl/core: Improve CXL core kernel docs Ben Widawsky
2021-07-15 23:46   ` Dan Williams
2021-07-15 19:41 ` [PATCH 3/6] cxl/core: Extract register and pmem functionality Ben Widawsky
2021-07-28 22:14   ` Dan Williams
2021-07-15 19:41 ` [PATCH 4/6] cxl/mem: Move character device region creation Ben Widawsky
2021-07-28 22:34   ` Dan Williams [this message]
2021-07-15 19:41 ` [PATCH 5/6] cxl: Pass fops and shutdown to memdev creation Ben Widawsky
2021-07-28 23:21   ` Dan Williams
2021-07-15 19:41 ` [PATCH 6/6] cxl/core: Move memdev management to core Ben Widawsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPcyv4ivzCJ=6OU2CcWB0ZuVkyK18g8KuBysc6cNjsmDf1nrzg@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=ben.widawsky@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=vishal.l.verma@intel.com \
    --subject='Re: [PATCH 4/6] cxl/mem: Move character device region creation' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).