Linux-ACPI Archive mirror
 help / color / mirror / Atom feed
From: Guanbing Huang <albanhuang0@gmail.com>
To: gregkh@linuxfoundation.org, andriy.shevchenko@intel.com,
	rafael.j.wysocki@intel.com
Cc: linux-acpi@vger.kernel.org, tony@atomide.com,
	john.ogness@linutronix.de, yangyicong@hisilicon.com,
	jirislaby@kernel.org, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org, lvjianmin@loongson.cn,
	albanhuang@tencent.com, tombinfan@tencent.com
Subject: [PATCH v8 2/3] serial: port: Add support of PNP IRQ to __uart_read_properties()
Date: Tue, 16 Apr 2024 11:16:37 +0800	[thread overview]
Message-ID: <7f4ca31ef1cab4c6ecad22fafd82117686b696be.1713234515.git.albanhuang@tencent.com> (raw)
In-Reply-To: <cover.1713234515.git.albanhuang@tencent.com>

From: Guanbing Huang <albanhuang@tencent.com>

The function __uart_read_properties doesn't cover PNP devices, so add IRQ
processing for PNP devices in the branch.

Signed-off-by: Guanbing Huang <albanhuang@tencent.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bing Fan <tombinfan@tencent.com>
Tested-by: Linheng Du <dylanlhdu@tencent.com>
---
v6 -> v7: add a "Reviewed-by" tag
v5 -> v6: fix the issue that the cover letter is not chained with the patch series
v4 -> v5: change "pnp" and "irq" in the commit message to uppercase, modify the subject
          to start with "serial: port:", modify the location of the header file pnp.h 

 drivers/tty/serial/serial_port.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/serial_port.c b/drivers/tty/serial/serial_port.c
index 22b9eeb23e68..8504bae1d2c9 100644
--- a/drivers/tty/serial/serial_port.c
+++ b/drivers/tty/serial/serial_port.c
@@ -11,6 +11,7 @@
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
+#include <linux/pnp.h>
 #include <linux/property.h>
 #include <linux/serial_core.h>
 #include <linux/spinlock.h>
@@ -221,7 +222,11 @@ static int __uart_read_properties(struct uart_port *port, bool use_defaults)
 
 	if (dev_is_platform(dev))
 		ret = platform_get_irq(to_platform_device(dev), 0);
-	else
+	else if (dev_is_pnp(dev)) {
+		ret = pnp_irq(to_pnp_dev(dev), 0);
+		if (ret < 0)
+			ret = -ENXIO;
+	} else
 		ret = fwnode_irq_get(dev_fwnode(dev), 0);
 	if (ret == -EPROBE_DEFER)
 		return ret;
-- 
2.17.1


  parent reply	other threads:[~2024-04-16  3:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16  3:15 [PATCH v8 0/3] serial: 8250_pnp: Support configurable reg shift property Guanbing Huang
2024-04-16  3:16 ` [PATCH v8 1/3] PNP: Add dev_is_pnp() macro Guanbing Huang
2024-04-16 13:51   ` Andy Shevchenko
2024-04-16 19:05   ` Rafael J. Wysocki
2024-04-16  3:16 ` Guanbing Huang [this message]
2024-04-16  3:16 ` [PATCH v8 3/3] serial: 8250_pnp: Support configurable reg shift property Guanbing Huang

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=7f4ca31ef1cab4c6ecad22fafd82117686b696be.1713234515.git.albanhuang@tencent.com \
    --to=albanhuang0@gmail.com \
    --cc=albanhuang@tencent.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lvjianmin@loongson.cn \
    --cc=rafael.j.wysocki@intel.com \
    --cc=tombinfan@tencent.com \
    --cc=tony@atomide.com \
    --cc=yangyicong@hisilicon.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).