diff mbox series

[2/6] cxl: Move cxl_memdev conversion helper to mem.h

Message ID 20210617173655.430424-3-ben.widawsky@intel.com
State New, archived
Headers show
Series Region creation | expand

Commit Message

Ben Widawsky June 17, 2021, 5:36 p.m. UTC
Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
---
 drivers/cxl/mem.h | 5 +++++
 drivers/cxl/pci.c | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Jonathan Cameron June 18, 2021, 9:13 a.m. UTC | #1
On Thu, 17 Jun 2021 10:36:51 -0700
Ben Widawsky <ben.widawsky@intel.com> wrote:

> Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Hard to argue with this one ;)  So I don't bother reading it again...

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/cxl/mem.h | 5 +++++
>  drivers/cxl/pci.c | 5 -----
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/cxl/mem.h b/drivers/cxl/mem.h
> index 8f02d02b26b4..fe12ef3c3dde 100644
> --- a/drivers/cxl/mem.h
> +++ b/drivers/cxl/mem.h
> @@ -48,6 +48,11 @@ struct cxl_memdev {
>  	int id;
>  };
>  
> +static inline struct cxl_memdev *to_cxl_memdev(struct device *dev)
> +{
> +       return container_of(dev, struct cxl_memdev, dev);
> +}
> +
>  /**
>   * struct cxl_mem - A CXL memory device
>   * @pdev: The PCI device associated with this CXL device.
> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
> index f8408e5f0754..52508282ec37 100644
> --- a/drivers/cxl/pci.c
> +++ b/drivers/cxl/pci.c
> @@ -1161,11 +1161,6 @@ static int cxl_mem_setup_regs(struct cxl_mem *cxlm)
>  	return ret;
>  }
>  
> -static struct cxl_memdev *to_cxl_memdev(struct device *dev)
> -{
> -	return container_of(dev, struct cxl_memdev, dev);
> -}
> -
>  static void cxl_memdev_release(struct device *dev)
>  {
>  	struct cxl_memdev *cxlmd = to_cxl_memdev(dev);
Dan Williams June 18, 2021, 3 p.m. UTC | #2
On Thu, Jun 17, 2021 at 10:37 AM Ben Widawsky <ben.widawsky@intel.com> wrote:
>

If you find yourself not writing a changelog it usually means the
patch has no reason to stand alone...

> Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
> ---
>  drivers/cxl/mem.h | 5 +++++
>  drivers/cxl/pci.c | 5 -----
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cxl/mem.h b/drivers/cxl/mem.h
> index 8f02d02b26b4..fe12ef3c3dde 100644
> --- a/drivers/cxl/mem.h
> +++ b/drivers/cxl/mem.h
> @@ -48,6 +48,11 @@ struct cxl_memdev {
>         int id;
>  };
>
> +static inline struct cxl_memdev *to_cxl_memdev(struct device *dev)
> +{
> +       return container_of(dev, struct cxl_memdev, dev);
> +}
> +
>  /**
>   * struct cxl_mem - A CXL memory device
>   * @pdev: The PCI device associated with this CXL device.
> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
> index f8408e5f0754..52508282ec37 100644
> --- a/drivers/cxl/pci.c
> +++ b/drivers/cxl/pci.c
> @@ -1161,11 +1161,6 @@ static int cxl_mem_setup_regs(struct cxl_mem *cxlm)
>         return ret;
>  }
>
> -static struct cxl_memdev *to_cxl_memdev(struct device *dev)
> -{
> -       return container_of(dev, struct cxl_memdev, dev);
> -}
> -
>  static void cxl_memdev_release(struct device *dev)
>  {
>         struct cxl_memdev *cxlmd = to_cxl_memdev(dev);
> --
> 2.32.0
>
diff mbox series

Patch

diff --git a/drivers/cxl/mem.h b/drivers/cxl/mem.h
index 8f02d02b26b4..fe12ef3c3dde 100644
--- a/drivers/cxl/mem.h
+++ b/drivers/cxl/mem.h
@@ -48,6 +48,11 @@  struct cxl_memdev {
 	int id;
 };
 
+static inline struct cxl_memdev *to_cxl_memdev(struct device *dev)
+{
+       return container_of(dev, struct cxl_memdev, dev);
+}
+
 /**
  * struct cxl_mem - A CXL memory device
  * @pdev: The PCI device associated with this CXL device.
diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
index f8408e5f0754..52508282ec37 100644
--- a/drivers/cxl/pci.c
+++ b/drivers/cxl/pci.c
@@ -1161,11 +1161,6 @@  static int cxl_mem_setup_regs(struct cxl_mem *cxlm)
 	return ret;
 }
 
-static struct cxl_memdev *to_cxl_memdev(struct device *dev)
-{
-	return container_of(dev, struct cxl_memdev, dev);
-}
-
 static void cxl_memdev_release(struct device *dev)
 {
 	struct cxl_memdev *cxlmd = to_cxl_memdev(dev);