Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9132868pxu; Mon, 28 Dec 2020 07:26:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJyusMD0prPVkW0Ex3OscwUeN4lCWBEgMe01Nsl7ae9NCt7c3+qZGbooDBDL9ZIa2pD6C0TX X-Received: by 2002:a17:907:3e17:: with SMTP id hp23mr41272810ejc.545.1609169166560; Mon, 28 Dec 2020 07:26:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609169166; cv=none; d=google.com; s=arc-20160816; b=DeB6S37GiCcMyxWwxtb6ExNzmhvavlhaD14/s39TrkfMriJyUqA+pl8g4torIit8iB MM9SLEkTGK/cm7su2pndf/L999ZobH87SLwZ0VYgAfAExogEtRqncndZ3KJQx6kXXsUC x8N/v3ZXE9BhBou/IbHYOTSf8GBbKRo9j5O/OC/nZWYlnoa0OQ4+7wAlHVmZgVMdLWbr GXmAIaemQNdkLuuU/OlZc5cseEeK96zjAEiuPI5yTRXm/JSvSVtsNxqqkopJFgaHX3wQ wazci4J5MVdgK0rJ8jleYKaM0gaFBfnZupgdd92aoIwR/PAkwlexQ36RNYbm32AeSbt9 G9Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j56YOlJW5lRvJcJ7tfI7RlXT8vA5T+tfP2ymqr7rh2M=; b=rNyQuB0XVnRtcBkBPdDIjuz86CSIVozhNG3DlG5BmPZQNNICH2LdA5iqYTDnXpNrna 2cqtbRCKPFskVc3j7Bo4OnRtfqX5oHdAI2dQTYpgyw/ElyxLqC7Q7oVWLQux9DV0Ok6U 3ruipLJbqhg46H/gmLDMqpL5nLRBPn0nGrzU/XSTTDB7AGFPvJi2uROhXBiydkzpMxKd UuLoJNNJYV9I3P9ro+TLRNxaUev0a+K5OGn08OwtzCiuHIWDx0ETBEn3q4OU5CDRnm/+ ROrFcMAJe3GVdCeCt0AVIVPuws22J2DFEaQJHWnjWOuPNIy8g2G0SZMwtBuWTW6+hwjD x4pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UPJG5POZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r5si20197058edo.330.2020.12.28.07.25.43; Mon, 28 Dec 2020 07:26:06 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UPJG5POZ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440893AbgL1PXH (ORCPT + 99 others); Mon, 28 Dec 2020 10:23:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:34824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408020AbgL1OBh (ORCPT ); Mon, 28 Dec 2020 09:01:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8628B206E5; Mon, 28 Dec 2020 14:01:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164082; bh=PKJn3+d49AZyCWIvBqInIUOl+zm6lm+zmz6v55aWkgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UPJG5POZtyaGPy7AUlcIHGK49wcVMLgkRsjViwiVK28eeQaWmOWXaR7o+J6mrFqPE 40jk27rAeT4vLXV5FRO/flhVXar4A0tA8eL0N6bVGVXYfOzOKHCN42BIzGXc2qXBRO 5pUDecDQcaSGisAQ3uWE/H7N6JvVJp3UQR+hNTUQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, YueHaibing , Laurent Pinchart , Sam Ravnborg , Sasha Levin Subject: [PATCH 5.10 054/717] drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe Date: Mon, 28 Dec 2020 13:40:52 +0100 Message-Id: <20201228125023.582584608@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: YueHaibing [ Upstream commit c2530cc9610d84a5a0118ba40d0f09309605047f ] gpiod_to_irq() return negative value in case of error, the existing code doesn't handle negative error codes. If the HPD gpio supports IRQs (gpiod_to_irq returns a valid number), we use the IRQ. If it doesn't (gpiod_to_irq returns an error), it gets polled via detect(). Fixes: cff5e6f7e83f ("drm/bridge: Add driver for the TI TPD12S015 HDMI level shifter") Signed-off-by: YueHaibing Reviewed-by: Laurent Pinchart Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20201102143024.26216-1-yuehaibing@huawei.com Signed-off-by: Sasha Levin --- 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 514cbf0eac75a..e0e015243a602 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 | -- 2.27.0