From patchwork Thu Dec 7 16:26:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 175274 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4900729vqy; Thu, 7 Dec 2023 08:26:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSZsH+c/h31zEtJpw/VwoeNf6YBIIIvZ/jl1szu0H7Kql1/sW2OA34kGaWi7eilSdTiqmk X-Received: by 2002:a05:6a20:760a:b0:18c:64b7:b217 with SMTP id m10-20020a056a20760a00b0018c64b7b217mr2337928pze.22.1701966405587; Thu, 07 Dec 2023 08:26:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701966405; cv=none; d=google.com; s=arc-20160816; b=KCRWNUcFqsGiSPnWijAiKkXyK790kQEb+ZCc6/55l1KsjpAB5QskeT2nJPg3A2oibw 7yfPuIYN9+a0MfiFWYqEwJrvT01iBCK+LRZATnXiAD73M/JLgb5DcNmHlSnSn0wGBFWp bGhnDCY9IdUIm6Rp7r2fdIJpigG0hBcy2bDLfZQbsmTyTWsS+sDer9RD7SIaAuEJeDfg gdXkZ6mBZbpo8mLQaKXuWUElThMIWRLbNdjKEGn4HfgCk1E7mSaf3BfL6mSW97PbnUM7 X9IR/Em9C+NY57GnULD2PltY3O41h80Pijck1fcdzBjck+qoeVXVACaP/KOZ/2Agjyys M3OA== 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 :message-id:date:subject:cc:to:from; bh=Ph0+mVciTk2L9HwyQnIvdszce9Yoav2XwfCrXeti/VE=; fh=7wHkuBVF8JoMvNinpa+GBBLyktbNyfNyBSxEZSIo6U0=; b=XjMxLFuVHgBCu7hnQPw+h96E5wmozpvM5NoqIQTHIC/+rVaOJhNMXYRFrGqpuiv/TK xcNl7lBWR37E7bo24gocQPLz+JsjKdfeqcm1HczSi4D+mqWT/4hOKJvJ3rMJYokQCmS0 tuY1pK5r7eMXlKaV5TXhn8sb2SuRnx8wnyIxPWDYJuI9FruvciPQtIslEnukIFipvMeq HesuEQYwLO5dPer7I/T45p+Z28KsGAF7EtcoxNdek8M7oOhQLkOakXiBfQmTHBtBZCem /e9VHpVWuKvO8nI3AWNNTe5alzWXRtTIB01OvIZNhkCU0PTm2PbeuqdOfg0CxAD/GETa 2FwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id l8-20020a6542c8000000b005c663502394si1381296pgp.609.2023.12.07.08.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 08:26:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B5D8380BA6AF; Thu, 7 Dec 2023 08:26:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232616AbjLGQ0e (ORCPT + 99 others); Thu, 7 Dec 2023 11:26:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbjLGQ0c (ORCPT ); Thu, 7 Dec 2023 11:26:32 -0500 Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E4F5E9; Thu, 7 Dec 2023 08:26:39 -0800 (PST) Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6d9d2f2b25aso679890a34.1; Thu, 07 Dec 2023 08:26:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701966399; x=1702571199; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ph0+mVciTk2L9HwyQnIvdszce9Yoav2XwfCrXeti/VE=; b=kKQNvj9sYoFXM0InCdTUn73Aer9NmWkO3FepPdRyvFBDce4GNMtTn4NRnz1RtkO6IY 99wUAWUARQuohOrcozmFQNB0F2TzX5k01J8fxr9isQe/y9zSsAOVnWV0cXCCYl4oFcFJ /mN8QJL+RpGJ1NUKHsYfus0EVuxX3VBaZlkc9XjyYM9Pe6fdCxh7CWnt2djOoaGbsJ0b iCnwviAkq0DUdE/JH3jL7CDl1lqbPAEqVtgh2zwC6ZADowv+OGmN71LOoBuMQa5tus73 1TKIaY+G3UmpHW4U/kn1wzkqScucSbXkeh4MYP1mRZpq55fefKPkbh7NK5kH7WIK3jbS cK+Q== X-Gm-Message-State: AOJu0YwlZdON00ONR+6xwXnHhgQxa2IxT9gfuy0qtSvYbG63tWU3KJZu 1g04B/J7v5BssYxEu+mu1ZQo5oKv+A== X-Received: by 2002:a05:6830:150a:b0:6d9:df71:9fc2 with SMTP id k10-20020a056830150a00b006d9df719fc2mr704750otp.8.1701966398685; Thu, 07 Dec 2023 08:26:38 -0800 (PST) Received: from herring.priv (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id z21-20020a05683020d500b006d99dd7492csm20233otq.42.2023.12.07.08.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 08:26:37 -0800 (PST) Received: (nullmailer pid 2651456 invoked by uid 1000); Thu, 07 Dec 2023 16:26:36 -0000 From: Rob Herring To: Greg Kroah-Hartman , Jiri Slaby Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 1/2] serial: esp32_acm: Add explicit platform_device.h include Date: Thu, 7 Dec 2023 10:26:30 -0600 Message-ID: <20231207162632.2650356-1-robh@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 07 Dec 2023 08:26:42 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784641125701067915 X-GMAIL-MSGID: 1784641125701067915 The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it was merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. Soon the implicit includes are going to be removed. Signed-off-by: Rob Herring --- drivers/tty/serial/esp32_acm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/esp32_acm.c b/drivers/tty/serial/esp32_acm.c index a4cbaedb5170..d4e8bdb1cdef 100644 --- a/drivers/tty/serial/esp32_acm.c +++ b/drivers/tty/serial/esp32_acm.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include From patchwork Thu Dec 7 16:26:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 175275 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4900909vqy; Thu, 7 Dec 2023 08:27:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/T6wtdNRFxbJGdsPJHb37jUr43cl5tgNaYW3Iy8WQENHYC6VKaM5F9e9Eh2/EqC6lwkiM X-Received: by 2002:a17:903:1d0:b0:1d0:b6b9:2504 with SMTP id e16-20020a17090301d000b001d0b6b92504mr2346338plh.66.1701966423267; Thu, 07 Dec 2023 08:27:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701966423; cv=none; d=google.com; s=arc-20160816; b=daEpD5dYKjs0vu2M+7UY2lER6y8n7iYrCAjev/RaSdZqTipH8sx5843c/nC5II444M E7CnE8PLJp/UsWrEPlmeTxKsjvoQnvWy+2c1siwzjQZmKuxVs0m8OCMDMmg0tHeuKcoJ dQhRny2TrMAYkn4tWLIjCoY2vVmPv0qCxSfhzHjpKzdG3UNXkYSXZRFtFpbuA30/46LP vakMRM+x6CZ+jYQQg4gyMpunLcX1YQFMeKsN6PTxcnz2XzeD0BFPh+eRLfIqejzYFsc8 FHYJMeq6yA363Aa1o41QqPIi7rBbkHIkXJe8fkAqtIVMrHvzALkBQb1CfWKzQ0SEH8q0 wtwA== 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:date:subject:cc:to:from; bh=LrIilKopCy+JlhjKJ757AT5TowHvKtEtJSE0B1E87zw=; fh=7wHkuBVF8JoMvNinpa+GBBLyktbNyfNyBSxEZSIo6U0=; b=PbNxZ61VkNxQW5MiuKE3yxX2E3Y+OCR3MTbkv+5DBVIykuB2kTwB6N5C8VIZoC4kfu AozhNCyHSqAZVDPjPLtWtkx0fRMfVh6zcl+aU+13oxdjzkKEfBrhfBs6yYWxi4tWPwz/ I3ZXfJC7/wiRL5x8FYOZa54aB/+MssTmFkdOJCoJ3kgcSRJNa5mom89+CAedAApwtrX5 GWeTymegrBqiBcA9LaxfNR7Pcx+zfqVFteIalvP2Pe6BAvBLjgr01nzNzOnTKifpvTWp pQVoegwjLS9YIMhJhXlN0IdSTHz57l9SAikB7b2crZxoa8+cfLzwT3gzlJSf1k/xjdH5 yu7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i7-20020a170902c94700b001cc4770b9aesi1438522pla.419.2023.12.07.08.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 08:27:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 57C6080323E4; Thu, 7 Dec 2023 08:27:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232851AbjLGQ0k (ORCPT + 99 others); Thu, 7 Dec 2023 11:26:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232745AbjLGQ0g (ORCPT ); Thu, 7 Dec 2023 11:26:36 -0500 Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E10512D; Thu, 7 Dec 2023 08:26:42 -0800 (PST) Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-1f5da5df68eso730575fac.2; Thu, 07 Dec 2023 08:26:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701966401; x=1702571201; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LrIilKopCy+JlhjKJ757AT5TowHvKtEtJSE0B1E87zw=; b=Wyh8DiYYuwiHoQduTHsez1N3CuY3h5RCHvQSV5/7bgH4l/UlK8zRO90nxxS9pVfV4X gW0iViKI0vhjFNLM8QU6UOZnPuqXwJ2Fi1gTbNXTsJCwIHGPNWHy40FnTUMFhYQs5/d9 YKZWpdIcMHuPtYYKRIPjDuyw+y6LhD5DeItYqIYJNGiobhfrQ8hIEDdYLmch1hGPBl1h o1zpLCcBYyx+Ar5Rocfqmcw4nMm/+4YzHl0o2jTDR2xR4wPz4UCU/AcNTxOTTk3WdCLC +JQavcMqozm2jcCWuUV1unX+0QvM39mbk1sAVN1Q3cpL55zHpUkPIfKzSmbdjBfVvyua B0Uw== X-Gm-Message-State: AOJu0YzJXTFavB375NNHGxT1upLXQwuZevuXMHlt6OB8ENe/1uAJkIzZ 2kJ43OKRoUw66tZrUtUB5412bMP60A== X-Received: by 2002:a05:6871:2b29:b0:1fa:d948:5992 with SMTP id dr41-20020a0568712b2900b001fad9485992mr2835849oac.54.1701966401694; Thu, 07 Dec 2023 08:26:41 -0800 (PST) Received: from herring.priv (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id my14-20020a056870698e00b001fb044ebdfdsm26453oab.13.2023.12.07.08.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 08:26:39 -0800 (PST) Received: (nullmailer pid 2651545 invoked by uid 1000); Thu, 07 Dec 2023 16:26:37 -0000 From: Rob Herring To: Greg Kroah-Hartman , Jiri Slaby Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 2/2] serial: esp32_uart: Use device_get_match_data() Date: Thu, 7 Dec 2023 10:26:31 -0600 Message-ID: <20231207162632.2650356-2-robh@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231207162632.2650356-1-robh@kernel.org> References: <20231207162632.2650356-1-robh@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 07 Dec 2023 08:27:00 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784641144156694151 X-GMAIL-MSGID: 1784641144156694151 Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Error checking for matching was not necessary as matching is always successful if we're already in probe and the match tables always have data pointers. Signed-off-by: Rob Herring --- drivers/tty/serial/esp32_uart.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/esp32_uart.c b/drivers/tty/serial/esp32_uart.c index 6e12955d1315..6fc61f323355 100644 --- a/drivers/tty/serial/esp32_uart.c +++ b/drivers/tty/serial/esp32_uart.c @@ -9,7 +9,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -678,16 +679,11 @@ static struct uart_driver esp32_uart_reg = { static int esp32_uart_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; - static const struct of_device_id *match; struct uart_port *port; struct esp32_port *sport; struct resource *res; int ret; - match = of_match_device(esp32_uart_dt_ids, &pdev->dev); - if (!match) - return -ENODEV; - sport = devm_kzalloc(&pdev->dev, sizeof(*sport), GFP_KERNEL); if (!sport) return -ENOMEM; @@ -728,7 +724,7 @@ static int esp32_uart_probe(struct platform_device *pdev) port->flags = UPF_BOOT_AUTOCONF; port->has_sysrq = 1; port->fifosize = ESP32_UART_TX_FIFO_SIZE; - port->private_data = (void *)match->data; + port->private_data = (void *)device_get_match_data(&pdev->dev); esp32_uart_ports[port->line] = sport;