On Sun, Sep 27, 2026 at 01:46:58PM -0700, Rosen Penev wrote: > Use platform_get_irq_optional() to be able to handle potential > -EPROBE_DEFER and other errors. Move it earlier to avoid having to call > kfree() on the global array. > > Signed-off-by: Rosen Penev <[email protected]> > --- > drivers/tty/hvc/hvc_opal.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c > index 402da9e7c534..fb9a566ca213 100644 > --- a/drivers/tty/hvc/hvc_opal.c > +++ b/drivers/tty/hvc/hvc_opal.c > @@ -13,7 +13,6 @@ > #include <linux/slab.h> > #include <linux/console.h> > #include <linux/of.h> > -#include <linux/of_irq.h> > #include <linux/platform_device.h> > #include <linux/export.h> > #include <linux/interrupt.h> > @@ -157,8 +156,9 @@ static int hvc_opal_probe(struct platform_device *dev) > struct hvc_struct *hp; > struct hvc_opal_priv *pv; > hv_protocol_t proto; > - unsigned int termno, irq, boot = 0; > + unsigned int termno, boot = 0; > const __be32 *reg; > + int irq; > > if (of_device_is_compatible(dev->dev.of_node, "ibm,opal-console-raw")) { > proto = HV_PROTOCOL_RAW; > @@ -176,6 +176,10 @@ static int hvc_opal_probe(struct platform_device *dev) > reg = of_get_property(dev->dev.of_node, "reg", NULL); > termno = reg ? be32_to_cpup(reg) : 0; > > + irq = platform_get_irq_optional(dev, 0); > + if (irq == -EPROBE_DEFER) > + return irq; > + > /* Is it our boot one ? */ > if (hvc_opal_privs[termno] == &hvc_opal_boot_priv) { > pv = hvc_opal_privs[termno]; > @@ -209,8 +213,7 @@ static int hvc_opal_probe(struct platform_device *dev) > dev->dev.of_node, > boot ? " (boot console)" : ""); > > - irq = irq_of_parse_and_map(dev->dev.of_node, 0); > - if (!irq) { > + if (irq < 0) { > pr_info("hvc%d: No interrupts property, using OPAL event\n", > termno); > irq = opal_event_request(ilog2(OPAL_EVENT_CONSOLE_INPUT)); > -- > 2.55.0 > >
Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - This looks like a new version of a previously submitted patch, but you did not list below the --- line any changes from the previous version. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/process/submitting-patches.rst for what needs to be done here to properly describe this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot
