Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2010594pxx; Sat, 31 Oct 2020 05:34:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDRj6haOvCn/ve51c4SUOCiO8sam0K1C5eZeZos5n9MXY9OvwogYrcbhTNDbup0AShhwkH X-Received: by 2002:a17:906:c0c8:: with SMTP id bn8mr7040763ejb.256.1604147685082; Sat, 31 Oct 2020 05:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604147685; cv=none; d=google.com; s=arc-20160816; b=JxMjq0lb8C9pjWiS65V2Biz6+Og3hjNUMrPkpTfz06aTZIV8f3WCVJ46uH+8azM+Gd UuM7wdoVt5T+wSETafBwdlseXpivs94tZL4eKOTGgRmUXXl8tJvw+7jn5+DnhKTRUc2O 8mDvwK9fp40azpYVda9UVZMKPMfGD2x64ZSKVx57qRsP3kP4Did29MXG1IAC9rkqICVI 4Aottxav6TAtVqs0tTBemHhwbbnBJjkMQe64YgNR/6PjDUBYvI3I5FVeGB7gRvAds+Ha HiU+8mSJ3R93a38Q6R8ofhf85IKlhtOfTKClaEe9CBh0LR6/Su4Xr4Cltaw+vOSo4iQM xhJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=c1iBhbhuloIrothgbkoCqxcaVCxDPVa7Ew2m/B/xIWg=; b=QOgbRodC6C5LjoJZT8rXAWbIuVdC0N9iWAQQ88xWng9RsWGyy/TvBPeM9TlpmK0bMf KRvQ42cZO1hjjV7ZtEsyp9ijvmmNfaf0xR8fXiB2frs2c/6YeP7+OmTlEt0HyAtChIUp jcrErjYATAerqWuYR4wYiSgs1MMaadGo5SCy+6lwL/S9OFCLO6jHgYE87PXsBpUS6jOD 7REjdN5cIOPOEQ+cfgiHwYvveyieYOXSWQ8dBlv1llXZ7+/Gxu3CsCePiGHUMAG9g1fe HoiQPkrnDsXd+r0k7u87PLJ41Z0wg/UQhPB2B3+1z3HsjJBFuE1iRmUekMDripr20cMy JOmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 5si3096791edo.577.2020.10.31.05.34.21; Sat, 31 Oct 2020 05:34:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727347AbgJaMca (ORCPT + 99 others); Sat, 31 Oct 2020 08:32:30 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7024 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727037AbgJaMca (ORCPT ); Sat, 31 Oct 2020 08:32:30 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CNdqF3r0mzhd6G; Sat, 31 Oct 2020 20:32:25 +0800 (CST) Received: from [10.174.176.180] (10.174.176.180) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Sat, 31 Oct 2020 20:32:23 +0800 Subject: Re: [PATCH] drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe To: Sam Ravnborg References: <20201031031648.42368-1-yuehaibing@huawei.com> <20201031071936.GA1044557@ravnborg.org> CC: , , , , , , , , , , From: Yuehaibing Message-ID: <24de298a-1b0b-8b2b-41c6-f68b1f5e1637@huawei.com> Date: Sat, 31 Oct 2020 20:32:23 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20201031071936.GA1044557@ravnborg.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.176.180] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/10/31 15:19, Sam Ravnborg wrote: > Hi YueHaibing > > Thanks for the fix. Appreciated but please update as per comments below. > > On Sat, Oct 31, 2020 at 11:16:48AM +0800, YueHaibing wrote: >> gpiod_to_irq() return negative value in case of error, >> the existing code handle negative error codes wrongly. >> >> Fixes: cff5e6f7e83f ("drm/bridge: Add driver for the TI TPD12S015 HDMI level shifter") >> Signed-off-by: YueHaibing >> --- >> drivers/gpu/drm/bridge/ti-tpd12s015.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/bridge/ti-tpd12s015.c b/drivers/gpu/drm/bridge/ti-tpd12s015.c >> index 514cbf0eac75..a18d5197c16c 100644 >> --- a/drivers/gpu/drm/bridge/ti-tpd12s015.c >> +++ b/drivers/gpu/drm/bridge/ti-tpd12s015.c >> @@ -160,7 +160,7 @@ static int tpd12s015_probe(struct platform_device *pdev) >> >> /* Register the IRQ if the HPD GPIO is IRQ-capable. */ >> tpd->hpd_irq = gpiod_to_irq(tpd->hpd_gpio); >> - if (tpd->hpd_irq) { >> + if (tpd->hpd_irq > 0) { >> ret = devm_request_threaded_irq(&pdev->dev, tpd->hpd_irq, NULL, >> tpd12s015_hpd_isr, >> IRQF_TRIGGER_RISING | > > The current implmentation will skip devm_request_threaded_irq() in case > or error - but continue with the rest of the function. So the > driver fails to return an error code. > > In case of error (negative value) then return early with that error Agree, will resubmit. > value. If gpiod_to_irq() returns 0 assume this is a valid irq and let > the code continue. gpiod_to_irq() never returns 0, so no need check this. > > Please fix and re-submit - or tell me if I am mistaken. > > Sam > . >