[PATCH] serial: samsung: Checks the return value of function
"uart_add_one_port" function call may fail and return some error code, so adding a check for return value. If it is returning some error code, then displaying the result and returning back from there. Signed-off-by: Tamseel Shams --- drivers/tty/serial/samsung_tty.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 6ef614d8648c..a220ba166ffe 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2072,7 +2072,11 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) } dev_dbg(>dev, "%s: adding port\n", __func__); - uart_add_one_port(_uart_drv, >port); + ret = uart_add_one_port(_uart_drv, >port); + if (ret < 0) { + dev_err(>dev, "Failed to add uart port, err %d\n", ret); + return ret; + } platform_set_drvdata(pdev, >port); /* -- 2.17.1
[RFT PATCH v5] serial: samsung: Removes the IRQ not found warning
In few older Samsung SoCs like s3c2410, s3c2412 and s3c2440, UART IP is having 2 interrupt lines. However, in other SoCs like s3c6400, s5pv210, exynos5433, and exynos4210 UART is having only 1 interrupt line. Due to this, "platform_get_irq(platdev, 1)" call in the driver gives the following false-positive error: "IRQ index 1 not found" on newer SoC's. This patch adds the condition to check for Tx interrupt only for the those SoC's which have 2 interrupt lines. Signed-off-by: Tamseel Shams --- Commit message is changed. Added RFT, for older platform. Addressed Krzysztof's review comments [1] [1] -> https://lkml.org/lkml/2020/7/21/150 drivers/tty/serial/samsung_tty.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 6ef614d8648c..b923683e6a25 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1911,9 +1911,11 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, ourport->tx_irq = ret + 1; } - ret = platform_get_irq(platdev, 1); - if (ret > 0) - ourport->tx_irq = ret; + if (!s3c24xx_serial_has_interrupt_mask(port)) { + ret = platform_get_irq(platdev, 1); + if (ret > 0) + ourport->tx_irq = ret; + } /* * DMA is currently supported only on DT platforms, if DMA properties * are specified. -- 2.17.1
[PATCH] serial: core: Fix Coding Style
This patch fixes the following checkpatch error and warning: 1. space required after ',' 2. Missing a blank line after declarations Signed-off-by: Tamseel Shams --- drivers/tty/serial/serial_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 66a5e2faf57e..9334e8d238b1 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1122,7 +1122,7 @@ static int uart_break_ctl(struct tty_struct *tty, int break_state) return ret; } -static int uart_do_autoconfig(struct tty_struct *tty,struct uart_state *state) +static int uart_do_autoconfig(struct tty_struct *tty, struct uart_state *state) { struct tty_port *port = >port; struct uart_port *uport; @@ -1525,6 +1525,7 @@ static void uart_set_termios(struct tty_struct *tty, /* Handle transition away from B0 status */ else if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) { unsigned int mask = TIOCM_DTR; + if (!(cflag & CRTSCTS) || !tty_throttled(tty)) mask |= TIOCM_RTS; uart_set_mctrl(uport, mask); @@ -2276,6 +2277,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) if (console_suspend_enabled || !uart_console(uport)) { /* Protected by port mutex for now */ struct tty_struct *tty = port->tty; + ret = ops->startup(uport); if (ret == 0) { if (tty) -- 2.17.1
RE: [PATCH v3] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC
> > In few older Samsung SoCs like s3c2410, s3c2412 and s3c2440, UART IP > > is having 2 interrupt lines. > > However, in other SoCs like s3c6400, s5pv210, exynos5433, and > > exynos4210 UART is having only 1 interrupt line. Due to this, > > "platform_get_irq(platdev, 1)" > > call in the driver gives the following warning: > > "IRQ index 1 not found" on recent platforms. > > > > This patch re-factors the IRQ resources handling for each platform and > > hence fixing the above warnings seen on some platforms. > > > > Signed-off-by: Tamseel Shams > > --- > > Removed the logic of irq_cnt and directly using > > s3c24xx_serial_has_interrupt_mask() to check for number of interrupt > > lines. > > > > drivers/tty/serial/samsung_tty.c | 7 +-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/tty/serial/samsung_tty.c > > b/drivers/tty/serial/samsung_tty.c > > index 6ef614d8648c..8a955f3d8975 100644 > > --- a/drivers/tty/serial/samsung_tty.c > > +++ b/drivers/tty/serial/samsung_tty.c > > @@ -1908,10 +1908,13 @@ static int s3c24xx_serial_init_port(struct > s3c24xx_uart_port *ourport, > > else { > > port->irq = ret; > > ourport->rx_irq = ret; > > - ourport->tx_irq = ret + 1; > > + if (s3c24xx_serial_has_interrupt_mask(port)) > > + ourport->tx_irq = ret; > > Hi, > > I don't understand: Why do you assign here the same interrupt as RX? > > Best regards, > Krzysztof > Hi Krzysztof, I was assigning the same interrupt to Tx and Rx for UART, which have one interrupt line, but ourport->tx_irq is never used for those UART's. So, leaving it as it was. The change now is using platform_get_irq_optional () instead of platform_get_irq () to avoid false-positive error. Thanks & Regards, Tamseel
[PATCH v4] serial: samsung: change to platform_get_irq_optional
In few older Samsung SoCs like s3c2410, s3c2412 and s3c2440, UART IP is having 2 interrupt lines. However, in other SoCs like s3c6400, s5pv210, exynos5433, and exynos4210 UART is having only 1 interrupt line. Due to this, "platform_get_irq(platdev, 1)" call in the driver gives the following false-positive error: "IRQ index 1 not found" on recent platforms. This patch replaces the platform_get_irq() call with platform_get_irq_optional() and hence avoiding the false-positive error. Signed-off-by: Tamseel Shams --- Commit message is changed. Addressed Krzysztof's previous comment. drivers/tty/serial/samsung_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 6ef614d8648c..c44582011b9b 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1911,7 +1911,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, ourport->tx_irq = ret + 1; } - ret = platform_get_irq(platdev, 1); + ret = platform_get_irq_optional(platdev, 1); if (ret > 0) ourport->tx_irq = ret; /* -- 2.17.1
[PATCH v3] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC
In few older Samsung SoCs like s3c2410, s3c2412 and s3c2440, UART IP is having 2 interrupt lines. However, in other SoCs like s3c6400, s5pv210, exynos5433, and exynos4210 UART is having only 1 interrupt line. Due to this, "platform_get_irq(platdev, 1)" call in the driver gives the following warning: "IRQ index 1 not found" on recent platforms. This patch re-factors the IRQ resources handling for each platform and hence fixing the above warnings seen on some platforms. Signed-off-by: Tamseel Shams --- Removed the logic of irq_cnt and directly using s3c24xx_serial_has_interrupt_mask() to check for number of interrupt lines. drivers/tty/serial/samsung_tty.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 6ef614d8648c..8a955f3d8975 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1908,10 +1908,13 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, else { port->irq = ret; ourport->rx_irq = ret; - ourport->tx_irq = ret + 1; + if (s3c24xx_serial_has_interrupt_mask(port)) + ourport->tx_irq = ret; + else + ourport->tx_irq = ret + 1; } - ret = platform_get_irq(platdev, 1); + ret = platform_get_irq_optional(platdev, 1); if (ret > 0) ourport->tx_irq = ret; /* -- 2.17.1
RE: [PATCH v2] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC
> On Sun, Jun 28, 2020 at 12:30:07PM +0530, Tamseel Shams wrote: > > In few older Samsung SoCs like s3c2410, s3c2412 and s3c2440, UART IP > > is having 2 interrupt lines. > > However, in other SoCs like s3c6400, s5pv210, exynos5433, and > > exynos4210 UART is having only 1 interrupt line. Due to this, > > "platform_get_irq(platdev, 1)" > > call in the driver gives the following warning: > > "IRQ index 1 not found" on recent platforms. > > > > This patch re-factors the IRQ resources handling for each platform and > > hence fixing the above warnings seen on some platforms. > > > > Signed-off-by: Tamseel Shams > > --- > > Removed the RFC tag and using 'platform_get_irq_optional' > > instead of 'platform_get_irq' as per comment received from Robin > > Murphy. > > > > drivers/tty/serial/samsung_tty.c | 14 -- > > 1 file changed, 12 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/tty/serial/samsung_tty.c > > b/drivers/tty/serial/samsung_tty.c > > index 6ef614d8648c..60554f42e208 100644 > > --- a/drivers/tty/serial/samsung_tty.c > > +++ b/drivers/tty/serial/samsung_tty.c > > @@ -60,6 +60,7 @@ struct s3c24xx_uart_info { > > char*name; > > unsigned inttype; > > unsigned intfifosize; > > + unsigned intirq_cnt; > > No, it's duplicating the logic. > > The driver already checks whether SoC has two or one interrupt line with > s3c24xx_serial_has_interrupt_mask() so there is no point to have two of such > methods. > > Instead unify it please. Probably entire > s3c24xx_serial_has_interrupt_mask() and s3c24xx_serial_type() should be > removed and switched into *serial_drv_data. > > Best regards, > Krzysztof Hi Krzysztof, Thanks for letting me know about duplication of logic. I will remove my logic of checking of number of interrupt line and replace it with check using s3c24xx_serial_has_interrupt_mask(). I will come up with another patch regarding the suggestion of removal of the two functions s3c24xx_serial_has_interrupt_mask() and s3c24xx_serial_type() and moving it to *serial_drv_data. Thanks & Regards, Tamseel
[PATCH v2] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC
In few older Samsung SoCs like s3c2410, s3c2412 and s3c2440, UART IP is having 2 interrupt lines. However, in other SoCs like s3c6400, s5pv210, exynos5433, and exynos4210 UART is having only 1 interrupt line. Due to this, "platform_get_irq(platdev, 1)" call in the driver gives the following warning: "IRQ index 1 not found" on recent platforms. This patch re-factors the IRQ resources handling for each platform and hence fixing the above warnings seen on some platforms. Signed-off-by: Tamseel Shams --- Removed the RFC tag and using 'platform_get_irq_optional' instead of 'platform_get_irq' as per comment received from Robin Murphy. drivers/tty/serial/samsung_tty.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 6ef614d8648c..60554f42e208 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -60,6 +60,7 @@ struct s3c24xx_uart_info { char*name; unsigned inttype; unsigned intfifosize; + unsigned intirq_cnt; unsigned long rx_fifomask; unsigned long rx_fifoshift; unsigned long rx_fifofull; @@ -1908,10 +1909,13 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, else { port->irq = ret; ourport->rx_irq = ret; - ourport->tx_irq = ret + 1; + if (ourport->info->irq_cnt == 1) + ourport->tx_irq = ret; + else + ourport->tx_irq = ret + 1; } - ret = platform_get_irq(platdev, 1); + ret = platform_get_irq_optional(platdev, 1); if (ret > 0) ourport->tx_irq = ret; /* @@ -2387,6 +2391,7 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { .name = "Samsung S3C2410 UART", .type = PORT_S3C2410, .fifosize = 16, + .irq_cnt= 2, .rx_fifomask= S3C2410_UFSTAT_RXMASK, .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT, .rx_fifofull= S3C2410_UFSTAT_RXFULL, @@ -2414,6 +2419,7 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { .name = "Samsung S3C2412 UART", .type = PORT_S3C2412, .fifosize = 64, + .irq_cnt= 2, .has_divslot= 1, .rx_fifomask= S3C2440_UFSTAT_RXMASK, .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, @@ -2443,6 +2449,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { .name = "Samsung S3C2440 UART", .type = PORT_S3C2440, .fifosize = 64, + .irq_cnt= 2, .has_divslot= 1, .rx_fifomask= S3C2440_UFSTAT_RXMASK, .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, @@ -2471,6 +2478,7 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { .name = "Samsung S3C6400 UART", .type = PORT_S3C6400, .fifosize = 64, + .irq_cnt= 1, .has_divslot= 1, .rx_fifomask= S3C2440_UFSTAT_RXMASK, .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, @@ -2498,6 +2506,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .info = &(struct s3c24xx_uart_info) { .name = "Samsung S5PV210 UART", .type = PORT_S3C6400, + .irq_cnt= 1, .has_divslot= 1, .rx_fifomask= S5PV210_UFSTAT_RXMASK, .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, @@ -2526,6 +2535,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .info = &(struct s3c24xx_uart_info) { \ .name = "Samsung Exynos UART",\ .type = PORT_S3C6400, \ + .irq_cnt= 1,\ .has_divslot= 1,\ .rx_fifomask= S5PV210_UFSTAT_RXMASK,\ .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, \ -- 2.17.1
RE: [RFC PATCH] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC
Hi Robin, > -Original Message- > From: Robin Murphy > Sent: Monday, June 15, 2020 6:43 PM > To: Tamseel Shams ; kg...@kernel.org; > k...@kernel.org; gre...@linuxfoundation.org; jsl...@suse.com > Cc: linux-samsung-...@vger.kernel.org; linux-ser...@vger.kernel.org; linux- > ker...@vger.kernel.org; alim.akh...@samsung.com; linux-arm- > ker...@lists.infradead.org > Subject: Re: [RFC PATCH] serial: samsung: Re-factors UART IRQ resource for > various Samsung SoC > > On 2020-06-15 13:26, Tamseel Shams wrote: > > else { > > port->irq = ret; > > ourport->rx_irq = ret; > > - ourport->tx_irq = ret + 1; > > + if (ourport->info->irq_cnt == 1) > > + ourport->tx_irq = ret; > > + else > > + ourport->tx_irq = ret + 1; > > } > > > > - ret = platform_get_irq(platdev, 1); > > - if (ret > 0) > > - ourport->tx_irq = ret; > > + if (ourport->info->irq_cnt != 1) { > > + ret = platform_get_irq(platdev, 1); > > + if (ret > 0) > > + ourport->tx_irq = ret; > > FWIW, if you're not going to do anything in the error case then you may as > well > just call platform_get_irq_optional() unconditionally. > > Robin. > My intention behind not using 'platform_get_irq_optional' was that it does not prints the error when the 2nd interrupt resource is missing for the older UART's. I am just using it to give information to the user in error case. I can use 'platform_get_irq_optional' too. Thanks & Regards Tamseel > > + } > > /* > > * DMA is currently supported only on DT platforms, if DMA properties > > * are specified. > > @@ -2387,6 +2393,7 @@ static struct s3c24xx_serial_drv_data > s3c2410_serial_drv_data = { > > .name = "Samsung S3C2410 UART", > > .type = PORT_S3C2410, > > .fifosize = 16, > > + .irq_cnt= 2, > > .rx_fifomask= S3C2410_UFSTAT_RXMASK, > > .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT, > > .rx_fifofull= S3C2410_UFSTAT_RXFULL,
RE: [RFC PATCH] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC
Hi Greg, I will post the patch without RFC tag. Thanks & Regards Tamseel > -Original Message- > From: Greg KH > Sent: Monday, June 15, 2020 6:21 PM > To: Tamseel Shams > Cc: kg...@kernel.org; k...@kernel.org; jsl...@suse.com; linux-arm- > ker...@lists.infradead.org; linux-samsung-...@vger.kernel.org; linux- > ser...@vger.kernel.org; linux-kernel@vger.kernel.org; > alim.akh...@samsung.com > Subject: Re: [RFC PATCH] serial: samsung: Re-factors UART IRQ resource for > various Samsung SoC > > On Mon, Jun 15, 2020 at 05:56:09PM +0530, Tamseel Shams wrote: > > In few older Samsung SoCs like s3c2410, s3c2412 and s3c2440, UART IP > > is having 2 interrupt lines. > > However, in other SoCs like s3c6400, s5pv210, exynos5433, and > > exynos4210 UART is having only 1 interrupt line. Due to this, > > "platform_get_irq(platdev, 1)" > > call in the driver gives the following warning: > > "IRQ index 1 not found" on recent platforms. > > > > This patch re-factors the IRQ resources handling for each platform and > > hence fixing the above warnings seen on some platforms. > > > > Signed-off-by: Tamseel Shams > > --- > > drivers/tty/serial/samsung_tty.c | 20 > > 1 file changed, 16 insertions(+), 4 deletions(-) > > RFC means "I do not trust this so I don't want anyone to merge it", so I'll just > delete it from my queue and wait for you to come up with something that you > feel confident with :) > > thanks, > > greg k-h
[PATCH] serial: samsung: fix spelling mistake
There is a spelling mistake in a comment. Fix it. Signed-off-by: Tamseel Shams --- drivers/tty/serial/samsung_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 6ef614d8648c..050a47fecdef 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -6,7 +6,7 @@ * http://armlinux.simtec.co.uk/ */ -/* Hote on 2410 error handling +/* Note on 2410 error handling * * The s3c2410 manual has a love/hate affair with the contents of the * UERSTAT register in the UART blocks, and keeps marking some of the -- 2.17.1
[RFC PATCH] serial: samsung: Re-factors UART IRQ resource for various Samsung SoC
In few older Samsung SoCs like s3c2410, s3c2412 and s3c2440, UART IP is having 2 interrupt lines. However, in other SoCs like s3c6400, s5pv210, exynos5433, and exynos4210 UART is having only 1 interrupt line. Due to this, "platform_get_irq(platdev, 1)" call in the driver gives the following warning: "IRQ index 1 not found" on recent platforms. This patch re-factors the IRQ resources handling for each platform and hence fixing the above warnings seen on some platforms. Signed-off-by: Tamseel Shams --- drivers/tty/serial/samsung_tty.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 6ef614d8648c..078dcb3e316f 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -60,6 +60,7 @@ struct s3c24xx_uart_info { char*name; unsigned inttype; unsigned intfifosize; + unsigned intirq_cnt; unsigned long rx_fifomask; unsigned long rx_fifoshift; unsigned long rx_fifofull; @@ -1908,12 +1909,17 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, else { port->irq = ret; ourport->rx_irq = ret; - ourport->tx_irq = ret + 1; + if (ourport->info->irq_cnt == 1) + ourport->tx_irq = ret; + else + ourport->tx_irq = ret + 1; } - ret = platform_get_irq(platdev, 1); - if (ret > 0) - ourport->tx_irq = ret; + if (ourport->info->irq_cnt != 1) { + ret = platform_get_irq(platdev, 1); + if (ret > 0) + ourport->tx_irq = ret; + } /* * DMA is currently supported only on DT platforms, if DMA properties * are specified. @@ -2387,6 +2393,7 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { .name = "Samsung S3C2410 UART", .type = PORT_S3C2410, .fifosize = 16, + .irq_cnt= 2, .rx_fifomask= S3C2410_UFSTAT_RXMASK, .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT, .rx_fifofull= S3C2410_UFSTAT_RXFULL, @@ -2414,6 +2421,7 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { .name = "Samsung S3C2412 UART", .type = PORT_S3C2412, .fifosize = 64, + .irq_cnt= 2, .has_divslot= 1, .rx_fifomask= S3C2440_UFSTAT_RXMASK, .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, @@ -2443,6 +2451,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { .name = "Samsung S3C2440 UART", .type = PORT_S3C2440, .fifosize = 64, + .irq_cnt= 2, .has_divslot= 1, .rx_fifomask= S3C2440_UFSTAT_RXMASK, .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, @@ -2471,6 +2480,7 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { .name = "Samsung S3C6400 UART", .type = PORT_S3C6400, .fifosize = 64, + .irq_cnt= 1, .has_divslot= 1, .rx_fifomask= S3C2440_UFSTAT_RXMASK, .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, @@ -2498,6 +2508,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .info = &(struct s3c24xx_uart_info) { .name = "Samsung S5PV210 UART", .type = PORT_S3C6400, + .irq_cnt= 1, .has_divslot= 1, .rx_fifomask= S5PV210_UFSTAT_RXMASK, .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, @@ -2526,6 +2537,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .info = &(struct s3c24xx_uart_info) { \ .name = "Samsung Exynos UART",\ .type = PORT_S3C6400, \ + .irq_cnt= 1,\ .has_divslot= 1,\ .rx_fifomask= S5PV210_UFSTAT_RXMASK,\ .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, \ -- 2.17.1
[PATCH v3] drm/exynos: Remove dev_err() on platform_get_irq() failure
platform_get_irq() will call dev_err() itself on failure, so there is no need for the driver to also do this. This is detected by coccinelle. Signed-off-by: Tamseel Shams --- - Changes since v2: * Addressed Inki Dae comments drivers/gpu/drm/exynos/exynos_drm_g2d.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index fcee33a43aca..03be31427181 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -1498,7 +1498,6 @@ static int g2d_probe(struct platform_device *pdev) g2d->irq = platform_get_irq(pdev, 0); if (g2d->irq < 0) { - dev_err(dev, "failed to get irq\n"); ret = g2d->irq; goto err_put_clk; } -- 2.17.1
RE: [PATCH v2] drm/exynos: Remove dev_err() on platform_get_irq() failure
> -Original Message- > From: Inki Dae > Sent: Wednesday, May 20, 2020 11:08 AM > To: Tamseel Shams ; jy0922.s...@samsung.com; > sw0312@samsung.com; kyungmin.p...@samsung.com; airl...@linux.ie; > dan...@ffwll.ch > Cc: dri-de...@lists.freedesktop.org; linux-arm-ker...@lists.infradead.org; > linux- > samsung-...@vger.kernel.org; linux-kernel@vger.kernel.org; > shaik.am...@samsung.com; k...@kernel.org; alim.akh...@samsung.com > Subject: Re: [PATCH v2] drm/exynos: Remove dev_err() on platform_get_irq() > failure > > Hi Tamseel, > > Same patch[1] has been merged. So could you re-post this patch after rebasing > it on top of exynos-drm-next branch? > After rebase, only g2d part would be valid. > Hi Inki Dae, Thanks for letting me know, I will send updated patch for G2D file. Thanks & Regards Tamseel Shams
[PATCH v2] drm/exynos: Remove dev_err() on platform_get_irq() failure
platform_get_irq() will call dev_err() itself on failure, so there is no need for the driver to also do this. This is detected by coccinelle. Also removing unnecessary curly braces around if () statement. Signed-off-by: Tamseel Shams --- Fixed review comment by j...@perches.com drivers/gpu/drm/exynos/exynos_drm_dsi.c | 4 +--- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 1 - drivers/gpu/drm/exynos/exynos_drm_rotator.c | 4 +--- drivers/gpu/drm/exynos/exynos_drm_scaler.c | 4 +--- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 902938d2568f..958e2c6a6702 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1809,10 +1809,8 @@ static int exynos_dsi_probe(struct platform_device *pdev) } dsi->irq = platform_get_irq(pdev, 0); - if (dsi->irq < 0) { - dev_err(dev, "failed to request dsi irq resource\n"); + if (dsi->irq < 0) return dsi->irq; - } irq_set_status_flags(dsi->irq, IRQ_NOAUTOEN); ret = devm_request_threaded_irq(dev, dsi->irq, NULL, diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index fcee33a43aca..03be31427181 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -1498,7 +1498,6 @@ static int g2d_probe(struct platform_device *pdev) g2d->irq = platform_get_irq(pdev, 0); if (g2d->irq < 0) { - dev_err(dev, "failed to get irq\n"); ret = g2d->irq; goto err_put_clk; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index dafa87b82052..2d94afba031e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -293,10 +293,8 @@ static int rotator_probe(struct platform_device *pdev) return PTR_ERR(rot->regs); irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(dev, "failed to get irq\n"); + if (irq < 0) return irq; - } ret = devm_request_irq(dev, irq, rotator_irq_handler, 0, dev_name(dev), rot); diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c index 93c43c8d914e..ce1857138f89 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c @@ -502,10 +502,8 @@ static int scaler_probe(struct platform_device *pdev) return PTR_ERR(scaler->regs); irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(dev, "failed to get irq\n"); + if (irq < 0) return irq; - } ret = devm_request_threaded_irq(dev, irq, NULL, scaler_irq_handler, IRQF_ONESHOT, "drm_scaler", scaler); -- 2.17.1
[PATCH] drm/exynos: Remove dev_err() on platform_get_irq() failure
platform_get_irq() will call dev_err() itself on failure, so there is no need for the driver to also do this. This is detected by coccinelle. Signed-off-by: Tamseel Shams --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 1 - drivers/gpu/drm/exynos/exynos_drm_g2d.c | 1 - drivers/gpu/drm/exynos/exynos_drm_rotator.c | 1 - drivers/gpu/drm/exynos/exynos_drm_scaler.c | 1 - 4 files changed, 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 902938d2568f..df2e14b19fbf 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1810,7 +1810,6 @@ static int exynos_dsi_probe(struct platform_device *pdev) dsi->irq = platform_get_irq(pdev, 0); if (dsi->irq < 0) { - dev_err(dev, "failed to request dsi irq resource\n"); return dsi->irq; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index fcee33a43aca..03be31427181 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -1498,7 +1498,6 @@ static int g2d_probe(struct platform_device *pdev) g2d->irq = platform_get_irq(pdev, 0); if (g2d->irq < 0) { - dev_err(dev, "failed to get irq\n"); ret = g2d->irq; goto err_put_clk; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index dafa87b82052..0edf7950a3fe 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -294,7 +294,6 @@ static int rotator_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) { - dev_err(dev, "failed to get irq\n"); return irq; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c index 93c43c8d914e..4e33d5661eef 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c @@ -503,7 +503,6 @@ static int scaler_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) { - dev_err(dev, "failed to get irq\n"); return irq; } -- 2.17.1