Re: [PATCH] crypto:amlogic - use platform_get_irq_optional()

From: Neil Armstrong
Date: Thu Apr 02 2020 - 11:35:49 EST


Hi,

On 02/04/2020 17:29, tangbin@xxxxxxxxxxxxxxxxxxxx wrote:
> Dear Neilï
> Â Â Â Â Thank you for your replayïmaybe my description is not so clearãWhat I want to say isïIn this place, when something goes wrong, platform_get_irq() will print an error message, and this function will print bothïso if we want to avoid the situation of repeat outputïwe can remove dev_err() here or use platform_get_irq_optional() Âinstead of platform_get_irq()ãThank you very muchã

Please do not top-post.

Since the irq is not optional, removing the dev_err() is the right way to go.

Neil

>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Â
> *From:*ÂNeil Armstrong <mailto:narmstrong@xxxxxxxxxxxx>
> *Date:*Â2020-04-02Â21:26
> *To:*ÂTang Bin <mailto:tangbin@xxxxxxxxxxxxxxxxxxxx>; clabbe <mailto:clabbe@xxxxxxxxxxxx>; herbert <mailto:herbert@xxxxxxxxxxxxxxxxxxx>; davem <mailto:davem@xxxxxxxxxxxxx>
> *CC:*Âlinux-amlogic <mailto:linux-amlogic@xxxxxxxxxxxxxxxxxxx>; linux-crypto <mailto:linux-crypto@xxxxxxxxxxxxxxx>; linux-kernel <mailto:linux-kernel@xxxxxxxxxxxxxxx>
> *Subject:*ÂRe: [PATCH] crypto:amlogic - use platform_get_irq_optional()
> Hi,
> Â
> On 02/04/2020 13:33, Tang Bin wrote:
> > In order to simply code,because platform_get_irq() already has
> > dev_err() message.
> >
> > Signed-off-by: Tang Bin <tangbin@xxxxxxxxxxxxxxxxxxxx>
> > ---
> >Â drivers/crypto/amlogic/amlogic-gxl-core.c | 2 +-
> >Â 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/amlogic/amlogic-gxl-core.c
> > index 9d4ead2f7..37901bd81 100644
> > --- a/drivers/crypto/amlogic/amlogic-gxl-core.c
> > +++ b/drivers/crypto/amlogic/amlogic-gxl-core.c
> > @@ -252,7 +252,7 @@ static int meson_crypto_probe(struct platform_device *pdev)
>
> >Â mc->irqs = devm_kcalloc(mc->dev, MAXFLOW, sizeof(int), GFP_KERNEL);
> >Â for (i = 0; i < MAXFLOW; i++) {
> > - mc->irqs[i] = platform_get_irq(pdev, i);
> > + mc->irqs[i] = platform_get_irq_optional(pdev, i);
> >Â if (mc->irqs[i] < 0) {
> >Â dev_err(mc->dev, "Cannot get IRQ for flow %d\n", i);
> >Â return mc->irqs[i];
> >
> Â
> NACK, the irq is not optional, I don't see why platform_get_irq_optional() should be used here
> and how it could "simply code".
> Â
> Neil
>