RE: [PATCH 1/2] gpio: realtek: Add GPIO support for RTD SoC variants

From: TY_Chang[張子逸]
Date: Fri Nov 03 2023 - 05:10:03 EST


Hi Krzysztof,

>>>> +static int rtd_gpio_probe(struct platform_device *pdev) {
>>>> + struct rtd_gpio *data;
>>>> + const struct of_device_id *match;
>>>> + struct device_node *node;
>>>> + int ret;
>>>> + int i;
>>>> +
>>>> + node = pdev->dev.of_node;
>>>> + match = of_match_node(rtd_gpio_of_matches, pdev->dev.of_node);
>>>> + if (!match || !match->data)
>>>> + return -EINVAL;
>>>> +
>>>> + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
>>>> + if (!data)
>>>> + return -ENOMEM;
>>>> +
>>>> + data->assert_irq = irq_of_parse_and_map(node, 0);
>>>> + if (!data->assert_irq)
>>>> + goto deferred;
>>>> +
>>>> + data->deassert_irq = irq_of_parse_and_map(node, 1);
>>>> + if (!data->deassert_irq)
>>>> + goto deferred;
>>>
>>> So this goes to cleanup path...
>>>
>>
>> Since there is no need to do devm_free, I will directly return -EPROBE_DEFER
>here.
>
>That's not a correct return value. You do not return DEFER on missing IRQ. This
>should anyway be different call: platform_get_irq().
>

I got it . Thank you for the reminder.

Thanks,
Tzuyi Chang