* [RFC PATCH] tty: atmel_serial: Use devm_platform_ioremap_resource()
@ 2024-10-21 6:43 Mihai Sain
2024-10-21 6:59 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Mihai Sain @ 2024-10-21 6:43 UTC (permalink / raw)
To: richard.genoud, gregkh, jirislaby, nicolas.ferre,
alexandre.belloni, claudiu.beznea, linux-kernel, linux-serial,
linux-arm-kernel
Cc: Mihai Sain
Simplify the request port function by using a single call
to devm_platform_ioremap_resource().
This will also enhance the printing from /proc/iomem:
cat /proc/iomem | grep flexcom ; cat /proc/iomem | grep serial
f0004000-f00041ff : f0004000.flexcom flexcom@f0004000
f8020000-f80201ff : f8020000.flexcom flexcom@f8020000
f0004200-f00043ff : f0004200.serial serial@200
f8020200-f80203ff : f8020200.serial serial@200
fffff200-fffff3ff : fffff200.serial serial@fffff200
Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
---
drivers/tty/serial/atmel_serial.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 09b246c9e389..e1107f14ec98 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -2419,17 +2419,11 @@ static void atmel_release_port(struct uart_port *port)
static int atmel_request_port(struct uart_port *port)
{
struct platform_device *mpdev = to_platform_device(port->dev->parent);
- int size = resource_size(mpdev->resource);
-
- if (!request_mem_region(port->mapbase, size, "atmel_serial"))
- return -EBUSY;
if (port->flags & UPF_IOREMAP) {
- port->membase = ioremap(port->mapbase, size);
- if (port->membase == NULL) {
- release_mem_region(port->mapbase, size);
- return -ENOMEM;
- }
+ port->membase = devm_platform_ioremap_resource(mpdev, 0);
+ if (IS_ERR(port->membase))
+ return PTR_ERR(port->membase);
}
return 0;
base-commit: 42f7652d3eb527d03665b09edac47f85fb600924
--
2.47.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [RFC PATCH] tty: atmel_serial: Use devm_platform_ioremap_resource()
2024-10-21 6:43 [RFC PATCH] tty: atmel_serial: Use devm_platform_ioremap_resource() Mihai Sain
@ 2024-10-21 6:59 ` Greg KH
2024-10-21 7:16 ` Mihai.Sain
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2024-10-21 6:59 UTC (permalink / raw)
To: Mihai Sain
Cc: richard.genoud, jirislaby, nicolas.ferre, alexandre.belloni,
claudiu.beznea, linux-kernel, linux-serial, linux-arm-kernel
On Mon, Oct 21, 2024 at 09:43:21AM +0300, Mihai Sain wrote:
> Simplify the request port function by using a single call
> to devm_platform_ioremap_resource().
>
> This will also enhance the printing from /proc/iomem:
>
> cat /proc/iomem | grep flexcom ; cat /proc/iomem | grep serial
>
> f0004000-f00041ff : f0004000.flexcom flexcom@f0004000
> f8020000-f80201ff : f8020000.flexcom flexcom@f8020000
> f0004200-f00043ff : f0004200.serial serial@200
> f8020200-f80203ff : f8020200.serial serial@200
> fffff200-fffff3ff : fffff200.serial serial@fffff200
>
> Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
> ---
> drivers/tty/serial/atmel_serial.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
Why is this a rfc? What needs to be done before you want it merged?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [RFC PATCH] tty: atmel_serial: Use devm_platform_ioremap_resource()
2024-10-21 6:59 ` Greg KH
@ 2024-10-21 7:16 ` Mihai.Sain
2024-10-21 7:24 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Mihai.Sain @ 2024-10-21 7:16 UTC (permalink / raw)
To: gregkh
Cc: richard.genoud, jirislaby, Nicolas.Ferre, alexandre.belloni,
claudiu.beznea, linux-kernel, linux-serial, linux-arm-kernel
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Monday, October 21, 2024 10:00 AM
> To: Mihai Sain - M19926 <Mihai.Sain@microchip.com>
> Cc: richard.genoud@bootlin.com; jirislaby@kernel.org; Nicolas Ferre - M43238
> <Nicolas.Ferre@microchip.com>; alexandre.belloni@bootlin.com;
> claudiu.beznea@tuxon.dev; linux-kernel@vger.kernel.org; linux-
> serial@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> Subject: Re: [RFC PATCH] tty: atmel_serial: Use
> devm_platform_ioremap_resource()
>
> On Mon, Oct 21, 2024 at 09:43:21AM +0300, Mihai Sain wrote:
> > Simplify the request port function by using a single call to
> > devm_platform_ioremap_resource().
> >
> > This will also enhance the printing from /proc/iomem:
> >
> > cat /proc/iomem | grep flexcom ; cat /proc/iomem | grep serial
> >
> > f0004000-f00041ff : f0004000.flexcom flexcom@f0004000
> > f8020000-f80201ff : f8020000.flexcom flexcom@f8020000
> > f0004200-f00043ff : f0004200.serial serial@200 f8020200-f80203ff :
> > f8020200.serial serial@200 fffff200-fffff3ff : fffff200.serial
> > serial@fffff200
> >
> > Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
> > ---
> > drivers/tty/serial/atmel_serial.c | 12 +++---------
> > 1 file changed, 3 insertions(+), 9 deletions(-)
>
> Why is this a rfc? What needs to be done before you want it merged?
I used the rfc tag in order to get the feedback from you and all stakeholders.
If the modifications are OK for you I will send a new patch without rfc tag.
Thanks,
Mihai
>
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC PATCH] tty: atmel_serial: Use devm_platform_ioremap_resource()
2024-10-21 7:16 ` Mihai.Sain
@ 2024-10-21 7:24 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2024-10-21 7:24 UTC (permalink / raw)
To: Mihai.Sain
Cc: richard.genoud, jirislaby, Nicolas.Ferre, alexandre.belloni,
claudiu.beznea, linux-kernel, linux-serial, linux-arm-kernel
On Mon, Oct 21, 2024 at 07:16:31AM +0000, Mihai.Sain@microchip.com wrote:
> > From: Greg KH <gregkh@linuxfoundation.org>
> > Sent: Monday, October 21, 2024 10:00 AM
> > To: Mihai Sain - M19926 <Mihai.Sain@microchip.com>
> > Cc: richard.genoud@bootlin.com; jirislaby@kernel.org; Nicolas Ferre - M43238
> > <Nicolas.Ferre@microchip.com>; alexandre.belloni@bootlin.com;
> > claudiu.beznea@tuxon.dev; linux-kernel@vger.kernel.org; linux-
> > serial@vger.kernel.org; linux-arm-kernel@lists.infradead.org
> > Subject: Re: [RFC PATCH] tty: atmel_serial: Use
> > devm_platform_ioremap_resource()
> >
> > On Mon, Oct 21, 2024 at 09:43:21AM +0300, Mihai Sain wrote:
> > > Simplify the request port function by using a single call to
> > > devm_platform_ioremap_resource().
> > >
> > > This will also enhance the printing from /proc/iomem:
> > >
> > > cat /proc/iomem | grep flexcom ; cat /proc/iomem | grep serial
> > >
> > > f0004000-f00041ff : f0004000.flexcom flexcom@f0004000
> > > f8020000-f80201ff : f8020000.flexcom flexcom@f8020000
> > > f0004200-f00043ff : f0004200.serial serial@200 f8020200-f80203ff :
> > > f8020200.serial serial@200 fffff200-fffff3ff : fffff200.serial
> > > serial@fffff200
> > >
> > > Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
> > > ---
> > > drivers/tty/serial/atmel_serial.c | 12 +++---------
> > > 1 file changed, 3 insertions(+), 9 deletions(-)
> >
> > Why is this a rfc? What needs to be done before you want it merged?
>
> I used the rfc tag in order to get the feedback from you and all stakeholders.
You need to ask for the feedback you are looking for, we don't know what
you feel is wrong here.
> If the modifications are OK for you I will send a new patch without rfc tag.
As we are drowning in real patches to review, I almost always just
ignore RFC patches as I know that means that the submitter feels there
is still more work to be done. So please always take that in mind.
Please ask for reviews from other developers in your company if you feel
it is not ready for our review.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-21 7:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-21 6:43 [RFC PATCH] tty: atmel_serial: Use devm_platform_ioremap_resource() Mihai Sain
2024-10-21 6:59 ` Greg KH
2024-10-21 7:16 ` Mihai.Sain
2024-10-21 7:24 ` Greg KH
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).