Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp126036lqq; Wed, 12 Jun 2024 19:54:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKhA0o9HJ4yJvhyAxFQW5RYtBGth7Um1/Kw3Neu4nmWZUSc4pEcI6hVl+Ndvj1fWDpG8mwZpPIPsJkUsgzS+pzt7yTxZhzWtNqDVGzmA== X-Google-Smtp-Source: AGHT+IGbbXGz7SgtGGSrgk+VHvHLns81468cQv1TLIWj2EPgsbcBZ+7peqLRZKCmEm54H0CWuNGM X-Received: by 2002:aa7:9f51:0:b0:705:cc7d:ab7d with SMTP id d2e1a72fcca58-705cc7dad25mr788933b3a.5.1718247265747; Wed, 12 Jun 2024 19:54:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718247265; cv=pass; d=google.com; s=arc-20160816; b=Mt/2TlHgEHWbci/Eiqyk8YdAItNqrULnnciU9jKyNo6nt/9zwtssqISC6KlJB7CTqc RlePYln6syGFNEew2DSScODqfSuOJLsWwUu1ZqA+5CpCOBDvekoW/a5ES7/a4RH9VZlZ qen5rNsRdF8QBfTCLUyzSS9st5rgDRnnSczM7eYBtFbJTIEkr8lllYDtUyDS0sMToUKQ 7AASg+Jnud/Hp3vl9CsLGsYUVTZHtHczI3+JhcNOBgCFJPXFKeByfx6eH+OrIjHsXpDB 3I1H+yDe16Zr77YgbHMUA5c8lxDCo54aKJtmO2k3TnY5T1LbI3vnZJypEDOksdGjgxIn AKsQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=uNmwMejHmNOh8I+RARUVaSfw/MphRluAD/hWf+7EyHM=; fh=IOXo0iKhdoDhL7kBJdbbmZ0OVcDRXaHHe6QVCBwo4uk=; b=bGlhSO0g8HmS56f+VSF/8409J+VC6R6LVMdk8EPT8kTZTMnCEKY80hufqDksnly7Mm 9A6HuDr2ZgSE0LAW6d4j7LZKNU+o6KmGvJq08EcM7jW8OtJo2vvqD8o8wK5FqtCG5yAC jWjrBnFqCiyEJOz0TYOzPGy+7B4CSkmGtGj8zUULC/ev/uXnlwg3gHFPzNbsUCtZyhmt BLdxfhSeyRRZcBfwXVYnE5tbbqnHKGFmDxak6x9mKqC56YJwpRQ9HvI3ikiJEWGCukCx ksz/6S/4Gcshrqb1QPt4WrXsCS/ZeKL3VmuKdh82/wpHWAJ2exuBY9lBcg3xFWsjtv5i jlJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bKvjd8qb; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-212502-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212502-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6fee5495b52si352753a12.631.2024.06.12.19.54.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 19:54:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212502-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bKvjd8qb; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-212502-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212502-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 355C8283199 for ; Thu, 13 Jun 2024 02:54:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDA8412CD8F; Thu, 13 Jun 2024 02:54:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bKvjd8qb" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E8AC79C0; Thu, 13 Jun 2024 02:54:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718247257; cv=none; b=Bt0aqMvXZ+Cwm2uIDNCkdrbu7U6hua/0+dvn1iQIhO0FmDCX1AV5QGQOJmmXSD+puR6TF7mFHQyWQhCuOoiCOtzliq8Ls6N3DJOfAqopDam8DXDYZNSFH0gBwM8oOP7dbjhP7N2I9lv05QvX4xjXWQ2V293yHcESiH/r1vwNluI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718247257; c=relaxed/simple; bh=832EzqDxWJ7nN/P5FfuAYp/Z11o7CeTnyqHfsasbrm8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RYqTR1vO49Zdee4HsuPe5qYrSg6yJgTzKHrVYBAQpw3J4h+CToJUkEp0W6fVs5O5sPTX35IzmV1K2VJeB1kXxekLVuKH6ZpWtOS3mTCXSxqr4CqCDJgLZaMjTyfTsgUjVfpPq30J5MC2uBdcQtj0nZLaRUKdOX4X0w7o8VYNRCk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bKvjd8qb; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-705c739b878so756530b3a.1; Wed, 12 Jun 2024 19:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718247256; x=1718852056; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=uNmwMejHmNOh8I+RARUVaSfw/MphRluAD/hWf+7EyHM=; b=bKvjd8qbuqszAWGmOoB8PwT5G3E+mgOFJjf5siuVPSY4+hmxgnTs578I6ThWgxMhpi yov03gOC7rwMeJDjoRAX3E/EC6StGx6+jBv+2if1AdjMvzy3luqY5CUKAwp7QQX2GOFt PWcRFtZRXJ67ZdRWV4//Ke5zZmAQ7nv6T7hS1RPC+Womy0iqLpbqPWKTtldKtjUQfuUE 01UMnc1tInL7CUB7PgjQXWgwLe30AdmTttJ04qQn0/31icNHdBjFyYdABqwsNnIXe7kc 8rxfob/uYVl9kVTZfGK5do1s1mV1H14MbG7BXPYq4RRQ31Ddz8bcuGMJ/6n0NwmFuGbz azeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718247256; x=1718852056; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uNmwMejHmNOh8I+RARUVaSfw/MphRluAD/hWf+7EyHM=; b=EtJY6GObqyYNeHUY/BozU2aDYJwg0UQDULSUcx0V2NI5qfd3p1BqDoiViZHQCVVyxY CVsJ0OabMV6QckLrntr/3fJsrAeJgJc+KmTGTtWpOTxS3mx/Q2gIR95aRRsP18A1HLnX NZ1+8pqFTBWCvs5kJswN57ADqO2j2lvPPNr8FzL2gDWnJAnyXR5tieG5KndZJrXqYFjl xkaC/aijqHvhplYtB3Xj1rO39taC+9ANLvLKmlN+W1cW4kAVcAjzlKSqR82VS2VQLB7q fIqKKIqayk4IvcZgDRpbWlamMDf4069GLDCftcyattdmn7Mewx/kpMoh5Ly8j2dYI95B 8S1A== X-Forwarded-Encrypted: i=1; AJvYcCXkpgiPRkczceBsP9V1Jlwcr9u2k3gW+NMaEM+nOAum3Zw0XxyDoZqImw+Vb7lTgFI3pbey+0ZoPnelEcdbqZYVX7QVPCzKaSQ5bY1yH+Rcj+5R6w7zgW+qTgAjWWb1aZKfUYcS7vR6yZVI X-Gm-Message-State: AOJu0YyrtkjwAn+GKRuksAcU5RZ6wjAyqMjhjfXzrHXM6vZGGUgl9/k4 tvfnKmxIfUktNetSdrqYf2xyjQTLmTH34eamFXZEYqb1CJr2ukAg X-Received: by 2002:a05:6a20:7485:b0:1b6:dc44:8211 with SMTP id adf61e73a8af0-1b8bef9e17emr2373909637.1.1718247255601; Wed, 12 Jun 2024 19:54:15 -0700 (PDT) Received: from [172.19.1.47] (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705cc925fe7sm296762b3a.19.2024.06.12.19.54.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Jun 2024 19:54:15 -0700 (PDT) Message-ID: <12baa918-2066-47b1-ab88-27d1dc6041b2@gmail.com> Date: Thu, 13 Jun 2024 10:54:12 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] tty: serial: ma35d1: Add a NULL check for of_node To: Greg KH Cc: dan.carpenter@linaro.org, jirislaby@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Jacky Huang References: <20240611092251.159149-1-ychuang570808@gmail.com> <2024061118-sycamore-leggings-05a9@gregkh> <73d2167a-84ee-40a4-a68d-ba25229ff8ce@gmail.com> <2024061226-laborious-jubilance-8df8@gregkh> Content-Language: en-US From: Jacky Huang In-Reply-To: <2024061226-laborious-jubilance-8df8@gregkh> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Dear Greg, On 2024/6/12 下午 03:23, Greg KH wrote: > On Wed, Jun 12, 2024 at 08:43:54AM +0800, Jacky Huang wrote: >> Dear Greg, >> >> >> On 2024/6/11 下午 07:11, Greg KH wrote: >>> On Tue, Jun 11, 2024 at 09:22:51AM +0000, Jacky Huang wrote: >>>> From: Jacky Huang >>>> >>>> The pdev->dev.of_node can be NULL if the "serial" node is absent. >>>> Add a NULL check to return an error in such cases. >>>> >>>> Signed-off-by: Jacky Huang >>>> --- >>>> drivers/tty/serial/ma35d1_serial.c | 13 +++++++------ >>>> 1 file changed, 7 insertions(+), 6 deletions(-) >>>> >>>> diff --git a/drivers/tty/serial/ma35d1_serial.c b/drivers/tty/serial/ma35d1_serial.c >>>> index 19f0a305cc43..3b4206e815fe 100644 >>>> --- a/drivers/tty/serial/ma35d1_serial.c >>>> +++ b/drivers/tty/serial/ma35d1_serial.c >>>> @@ -688,12 +688,13 @@ static int ma35d1serial_probe(struct platform_device *pdev) >>>> struct uart_ma35d1_port *up; >>>> int ret = 0; >>>> - if (pdev->dev.of_node) { >>>> - ret = of_alias_get_id(pdev->dev.of_node, "serial"); >>>> - if (ret < 0) { >>>> - dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n", ret); >>>> - return ret; >>>> - } >>>> + if (!pdev->dev.of_node) >>>> + return -ENODEV; >>>> + >>>> + ret = of_alias_get_id(pdev->dev.of_node, "serial"); >>>> + if (ret < 0) { >>>> + dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n", ret); >>>> + return ret; >>>> } >>>> up = &ma35d1serial_ports[ret]; >>>> up->port.line = ret; >>> What commit id does this fix? >>> >>> thanks, >>> >>> greg k-h >> This patch fix the in tree ma35d1 serial driver. >> The last commit for ma35d1_serial.c is >> '6b64f8e360c00f180cffa1806095cdd2abc55b16'. > That is obviously not the commit that causes this problem, which is what > I was looking for here. Shouldn't you include a "Fixes:" line if this > is resolving a bug? > > thanks, > > greg k-h I got it. The  commit that cause this problem is '930cbf92db01'. And I will send v2 patch with the "Fixes:" line. Fixes: 930cbf92db01 ("tty: serial: Add Nuvoton ma35d1 serial driver support") Best Regards, Jacky Huang