Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1041764pxb; Sun, 22 Aug 2021 04:19:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI/EyICH1FKEHvBJEvm146NBcxSajGzjLuGTpXUDjiE6qlzdZdYZuju/KfCwTHnDNg8BOK X-Received: by 2002:aa7:cc83:: with SMTP id p3mr32323847edt.365.1629631147140; Sun, 22 Aug 2021 04:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629631147; cv=none; d=google.com; s=arc-20160816; b=n5QclKRFmgVO2cuBERiPk/kUuJC3MLwueiZv3puFblu/8VfdSLAHr2qViJGU0GCy1y iskmHnDm+kzJmv3GkGg77H4FtWspR9GXK+RyJ1tE9e8EVMT8fn3OM4/nhYqxsrk+DWv6 MyYoKqxrbkKGbMI+W9qDjAHZTC9sw2s7UQuBRcOhbbwsTF3wg2XnvMwXqzPlIWx+3gA2 VP0yfvfAwt5Grwn/et6c17CFF2X9AbhRweA6VjLo0Jo0dzuuB+vwKCyAWkGlytI3gz+4 ejig3EhKYuiRUDgbaduiOHHa/oLVUhoUOUKNMxVhKzA9x2pFWQdN7uX+yuBFZfcHPUDw G29Q== 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 :references:in-reply-to:message-id:cc:to:subject:from:date; bh=7sZPrf1Bpg8N1Dl7J4mOYwvy65/35G9T0uzi9YtvgrQ=; b=KU7s/t6YYoRhaZgfGMqszku7S8Rm6Z84+58sauVj7x80Db0yCwEjADhKiAJtsDPN9j GOeFNj6CWTz1CrkkEvk/HhQdCuUwDHuQ2y56Obafg6B4CL1wNumaltKmZvEXmGDr8pUn WQSviSka5s13J+ZNmrkasM9C8X/UgBMPx5TqRsDpfvG9/YlwporIs0UpOm20HupZsVZt nQ6BaoF0GR4jpn3Zax9zfuLMlB+OI8ZzNs7uANXjehFulUOlhZ9B+I8xJm46HT7LckGM NJbYJvYLuo6laxYd/voYJKRrko3TeGMq9YC5hJMneM5zYWovirdAVXQvJBdUdqD7yWJS WUWQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e26si13813053edr.357.2021.08.22.04.18.29; Sun, 22 Aug 2021 04:19:07 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233387AbhHVLRX convert rfc822-to-8bit (ORCPT + 99 others); Sun, 22 Aug 2021 07:17:23 -0400 Received: from aposti.net ([89.234.176.197]:45274 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232822AbhHVLRX (ORCPT ); Sun, 22 Aug 2021 07:17:23 -0400 Date: Sun, 22 Aug 2021 12:16:29 +0100 From: Paul Cercueil Subject: Re: [PATCH 1/3] serial: 8250_ingenic: Use of_device_get_match_data To: Tang Bin Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org, ldewangan@nvidia.com, thierry.reding@gmail.com, jonathanh@nvidia.com, linux@prisktech.co.nz, linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Zhang Shengju Message-Id: In-Reply-To: <20210822032806.3256-2-tangbin@cmss.chinamobile.com> References: <20210822032806.3256-1-tangbin@cmss.chinamobile.com> <20210822032806.3256-2-tangbin@cmss.chinamobile.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Le dim., ao?t 22 2021 at 11:28:04 +0800, Tang Bin a ?crit : > Retrieve OF match data, it's better and cleaner to use > 'of_device_get_match_data' over 'of_match_device'. > > Signed-off-by: Zhang Shengju > Signed-off-by: Tang Bin Acked-by: Paul Cercueil Cheers, -Paul > --- > drivers/tty/serial/8250/8250_ingenic.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_ingenic.c > b/drivers/tty/serial/8250/8250_ingenic.c > index 988bf6bcc..65402d05e 100644 > --- a/drivers/tty/serial/8250/8250_ingenic.c > +++ b/drivers/tty/serial/8250/8250_ingenic.c > @@ -209,16 +209,14 @@ static int ingenic_uart_probe(struct > platform_device *pdev) > struct uart_8250_port uart = {}; > struct ingenic_uart_data *data; > const struct ingenic_uart_config *cdata; > - const struct of_device_id *match; > struct resource *regs; > int irq, err, line; > > - match = of_match_device(of_match, &pdev->dev); > - if (!match) { > + cdata = of_device_get_match_data(&pdev->dev); > + if (!cdata) { > dev_err(&pdev->dev, "Error: No device match found\n"); > return -ENODEV; > } > - cdata = match->data; > > irq = platform_get_irq(pdev, 0); > if (irq < 0) > -- > 2.20.1.windows.1 > > >