2014-06-19 18:49:28

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 0/3] Remove devm_request_and_ioremap()

Pretty much a year ago, Tushar cleaned up a lot of deprecated uses of
devm_request_and_ioremap, yet some remains are still left. Remove the last two
users, and let the function rest in peace. I'd suggest that this series is
picked up as a whole to have that case finally closed. Greg? Are you interested
in picking it up?

Wolfram


Tushar Behera (2):
DRM: Armada: Use devm_ioremap_resource
lib: devres: Remove deprecated devm_request_and_ioremap

Wolfram Sang (1):
bus: brcmstb_gisb: Use devm_ioremap_resource

Documentation/driver-model/devres.txt | 1 -
drivers/bus/brcmstb_gisb.c | 6 +++---
drivers/gpu/drm/armada/armada_crtc.c | 8 +++-----
include/linux/device.h | 2 --
lib/devres.c | 28 ----------------------------
5 files changed, 6 insertions(+), 39 deletions(-)

--
2.0.0


2014-06-19 18:49:31

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 2/3] bus: brcmstb_gisb: Use devm_ioremap_resource

From: Wolfram Sang <[email protected]>

devm_request_and_ioremap is deprecated.

Signed-off-by: Wolfram Sang <[email protected]>
---
drivers/bus/brcmstb_gisb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c
index 6159b7752a64..f2cd6a2d40b4 100644
--- a/drivers/bus/brcmstb_gisb.c
+++ b/drivers/bus/brcmstb_gisb.c
@@ -212,9 +212,9 @@ static int brcmstb_gisb_arb_probe(struct platform_device *pdev)
mutex_init(&gdev->lock);
INIT_LIST_HEAD(&gdev->next);

- gdev->base = devm_request_and_ioremap(&pdev->dev, r);
- if (!gdev->base)
- return -ENOMEM;
+ gdev->base = devm_ioremap_resource(&pdev->dev, r);
+ if (IS_ERR(gdev->base))
+ return PTR_ERR(gdev->base);

err = devm_request_irq(&pdev->dev, timeout_irq,
brcmstb_gisb_timeout_handler, 0, pdev->name,
--
2.0.0

2014-06-19 18:49:34

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 3/3] lib: devres: Remove deprecated devm_request_and_ioremap

From: Tushar Behera <[email protected]>

Now that all the users of devm_request_and_ioremap have been converted
to use devm_ioremap_resource, remove it. Also remove the entries from
Documentation.

Signed-off-by: Tushar Behera <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
---
Documentation/driver-model/devres.txt | 1 -
include/linux/device.h | 2 --
lib/devres.c | 28 ----------------------------
3 files changed, 31 deletions(-)

diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index 1525e30483fd..de6bc8c325e9 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -278,7 +278,6 @@ IOMAP
devm_ioremap_nocache()
devm_iounmap()
devm_ioremap_resource() : checks resource, requests memory region, ioremaps
- devm_request_and_ioremap() : obsoleted by devm_ioremap_resource()
pcim_iomap()
pcim_iounmap()
pcim_iomap_table() : array of mapped addresses indexed by BAR
diff --git a/include/linux/device.h b/include/linux/device.h
index af424acd393d..921fa0a74df6 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -631,8 +631,6 @@ extern unsigned long devm_get_free_pages(struct device *dev,
extern void devm_free_pages(struct device *dev, unsigned long addr);

void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
-void __iomem *devm_request_and_ioremap(struct device *dev,
- struct resource *res);

/* allows to add/remove a custom action to devres stack */
int devm_add_action(struct device *dev, void (*action)(void *), void *data);
diff --git a/lib/devres.c b/lib/devres.c
index f562bf6ff71d..6a4aee8a3a7e 100644
--- a/lib/devres.c
+++ b/lib/devres.c
@@ -142,34 +142,6 @@ void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res)
}
EXPORT_SYMBOL(devm_ioremap_resource);

-/**
- * devm_request_and_ioremap() - Check, request region, and ioremap resource
- * @dev: Generic device to handle the resource for
- * @res: resource to be handled
- *
- * Takes all necessary steps to ioremap a mem resource. Uses managed device, so
- * everything is undone on driver detach. Checks arguments, so you can feed
- * it the result from e.g. platform_get_resource() directly. Returns the
- * remapped pointer or NULL on error. Usage example:
- *
- * res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- * base = devm_request_and_ioremap(&pdev->dev, res);
- * if (!base)
- * return -EADDRNOTAVAIL;
- */
-void __iomem *devm_request_and_ioremap(struct device *dev,
- struct resource *res)
-{
- void __iomem *dest_ptr;
-
- dest_ptr = devm_ioremap_resource(dev, res);
- if (IS_ERR(dest_ptr))
- return NULL;
-
- return dest_ptr;
-}
-EXPORT_SYMBOL(devm_request_and_ioremap);
-
#ifdef CONFIG_HAS_IOPORT_MAP
/*
* Generic iomap devres
--
2.0.0

2014-06-19 18:50:01

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 1/3] DRM: Armada: Use devm_ioremap_resource

From: Tushar Behera <[email protected]>

While at it, propagate the error code.

Signed-off-by: Tushar Behera <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
---
drivers/gpu/drm/armada/armada_crtc.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
index 81c34f949dfc..3aedf9e993e6 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -1039,11 +1039,9 @@ int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
if (ret)
return ret;

- base = devm_request_and_ioremap(dev->dev, res);
- if (!base) {
- DRM_ERROR("failed to ioremap register\n");
- return -ENOMEM;
- }
+ base = devm_ioremap_resource(dev->dev, res);
+ if (IS_ERR(base))
+ return PTR_ERR(base);

dcrtc = kzalloc(sizeof(*dcrtc), GFP_KERNEL);
if (!dcrtc) {
--
2.0.0

2014-06-19 18:50:57

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 0/3] Remove devm_request_and_ioremap()

On Thu, Jun 19, 2014 at 08:48:58PM +0200, Wolfram Sang wrote:
> Pretty much a year ago, Tushar cleaned up a lot of deprecated uses of
> devm_request_and_ioremap, yet some remains are still left. Remove the last two
> users, and let the function rest in peace. I'd suggest that this series is
> picked up as a whole to have that case finally closed. Greg? Are you interested
> in picking it up?

Note to self: Add Greg to CC list when asking him...


Attachments:
(No filename) (449.00 B)
signature.asc (819.00 B)
Digital signature
Download all attachments

2014-06-20 02:36:10

by Jingoo Han

[permalink] [raw]
Subject: Re: [PATCH 0/3] Remove devm_request_and_ioremap()

On Friday, June 20, 2014 3:49 AM, Wolfram Sang wrote:
>
> Pretty much a year ago, Tushar cleaned up a lot of deprecated uses of
> devm_request_and_ioremap, yet some remains are still left. Remove the last two
> users, and let the function rest in peace. I'd suggest that this series is
> picked up as a whole to have that case finally closed. Greg? Are you interested
> in picking it up?

(+cc Greg Kroah-Hartman)

I already sent the same patch as one single patch to Greg Kroah-Hartman. [1]
Also, it was accepted by Greg Kroah-Hartman. [2] Thank you.

[1] https://lkml.org/lkml/2014/6/11/26
[2] https://lkml.org/lkml/2014/6/11/649

Best regards,
Jingoo Han

>
> Wolfram
>
>
> Tushar Behera (2):
> DRM: Armada: Use devm_ioremap_resource
> lib: devres: Remove deprecated devm_request_and_ioremap
>
> Wolfram Sang (1):
> bus: brcmstb_gisb: Use devm_ioremap_resource
>
> Documentation/driver-model/devres.txt | 1 -
> drivers/bus/brcmstb_gisb.c | 6 +++---
> drivers/gpu/drm/armada/armada_crtc.c | 8 +++-----
> include/linux/device.h | 2 --
> lib/devres.c | 28 ----------------------------
> 5 files changed, 6 insertions(+), 39 deletions(-)
>
> --
> 2.0.0

2014-06-20 02:55:58

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 0/3] Remove devm_request_and_ioremap()

On Fri, Jun 20, 2014 at 11:36:03AM +0900, Jingoo Han wrote:
> On Friday, June 20, 2014 3:49 AM, Wolfram Sang wrote:
> >
> > Pretty much a year ago, Tushar cleaned up a lot of deprecated uses of
> > devm_request_and_ioremap, yet some remains are still left. Remove the last two
> > users, and let the function rest in peace. I'd suggest that this series is
> > picked up as a whole to have that case finally closed. Greg? Are you interested
> > in picking it up?
>
> (+cc Greg Kroah-Hartman)
>
> I already sent the same patch as one single patch to Greg Kroah-Hartman. [1]
> Also, it was accepted by Greg Kroah-Hartman. [2] Thank you.
>
> [1] https://lkml.org/lkml/2014/6/11/26
> [2] https://lkml.org/lkml/2014/6/11/649

Yeah, I'll go apply that right now while I'm remembering it :)

thanks,

greg k-h

2014-06-20 06:47:44

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 0/3] Remove devm_request_and_ioremap()

> > I already sent the same patch as one single patch to Greg Kroah-Hartman. [1]
> > Also, it was accepted by Greg Kroah-Hartman. [2] Thank you.
> >
> > [1] https://lkml.org/lkml/2014/6/11/26
> > [2] https://lkml.org/lkml/2014/6/11/649
>
> Yeah, I'll go apply that right now while I'm remembering it :)

Yay, great! Thank you both!


Attachments:
(No filename) (335.00 B)
signature.asc (819.00 B)
Digital signature
Download all attachments

2014-06-20 08:45:15

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 0/3] Remove devm_request_and_ioremap()

On Thu, Jun 19, 2014 at 07:59:57PM -0700, 'Greg Kroah-Hartman' wrote:
> On Fri, Jun 20, 2014 at 11:36:03AM +0900, Jingoo Han wrote:
> > On Friday, June 20, 2014 3:49 AM, Wolfram Sang wrote:
> > >
> > > Pretty much a year ago, Tushar cleaned up a lot of deprecated uses of
> > > devm_request_and_ioremap, yet some remains are still left. Remove the last two
> > > users, and let the function rest in peace. I'd suggest that this series is
> > > picked up as a whole to have that case finally closed. Greg? Are you interested
> > > in picking it up?
> >
> > (+cc Greg Kroah-Hartman)
> >
> > I already sent the same patch as one single patch to Greg Kroah-Hartman. [1]
> > Also, it was accepted by Greg Kroah-Hartman. [2] Thank you.
> >
> > [1] https://lkml.org/lkml/2014/6/11/26
> > [2] https://lkml.org/lkml/2014/6/11/649
>
> Yeah, I'll go apply that right now while I'm remembering it :)

For the patch above:

Reviewed-by: Wolfram Sang <[email protected]>


Attachments:
(No filename) (963.00 B)
signature.asc (819.00 B)
Digital signature
Download all attachments

2014-06-20 08:52:01

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH 0/3] Remove devm_request_and_ioremap()

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/20/2014 02:15 PM, Wolfram Sang wrote:
> On Thu, Jun 19, 2014 at 07:59:57PM -0700, 'Greg Kroah-Hartman'
> wrote:
>> On Fri, Jun 20, 2014 at 11:36:03AM +0900, Jingoo Han wrote:
>>> On Friday, June 20, 2014 3:49 AM, Wolfram Sang wrote:
>>>>
>>>> Pretty much a year ago, Tushar cleaned up a lot of deprecated
>>>> uses of devm_request_and_ioremap, yet some remains are still
>>>> left. Remove the last two users, and let the function rest in
>>>> peace. I'd suggest that this series is picked up as a whole
>>>> to have that case finally closed. Greg? Are you interested in
>>>> picking it up?
>>>
>>> (+cc Greg Kroah-Hartman)
>>>
>>> I already sent the same patch as one single patch to Greg
>>> Kroah-Hartman. [1] Also, it was accepted by Greg Kroah-Hartman.
>>> [2] Thank you.
>>>
>>> [1] https://lkml.org/lkml/2014/6/11/26 [2]
>>> https://lkml.org/lkml/2014/6/11/649
>>
>> Yeah, I'll go apply that right now while I'm remembering it :)
>
> For the patch above:
>
> Reviewed-by: Wolfram Sang <[email protected]>
>

If it is still not late,

Acked-by: Tushar Behera <[email protected]>

- --
Tushar Behera
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTo/YpAAoJELqclMPPkq4NOsIIAIkN+lOgWTIo3IBw7oQ9yO76
Hjn6fR2kjWOdrXrTdW3KQRzElw8hMKdPF5++GkgAkreoLSxRBLnyHdGc0jPdmxXw
gIu4O0WNQYRKYN+fkHPkl/5z10SNmZrnwcq37FK8EMCqpph7JywYOu5WyNVjMKOh
gTJ9zME+iCAzE+KlzBr7pRLySkFvgtITqBRT/lsRmGGpjH+kphSmYuY2kvz2VVLI
DE6Zy8kOyZEEDwDsm62qhoZNtzKcGoZgSqNFKU8fM9duonRhAwUQKImUnKB1H1CD
FQcmZI/4WA/6OLypUSBj/AIciK1MW/Gu6IpILjNVwQA/q3CKEaUkiHf+2HNVohU=
=FBDs
-----END PGP SIGNATURE-----