From patchwork Mon Apr 8 03:36:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guanbing Huang X-Patchwork-Id: 787572 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01olkn2028.outbound.protection.outlook.com [40.92.53.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B45B05244; Mon, 8 Apr 2024 03:36:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.92.53.28 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712547408; cv=fail; b=FJNv9fBAQr1Xca0Q1kOyfKX4v0+EZSfQQkxKm/+E8lj/7iftZELgfF3ajpdfjtLP4vI3oXWewUnAq2PbaXOhcamTmOqjXGamJJGJ93OPZ9HMlVfQ6IWAFxeVT5E6FNKX1XMQk0IjJdUdbdpPGa9AjkYTu1PcsBKnNfjtoGXcero= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712547408; c=relaxed/simple; bh=cMyIdOCMZt6YWmxQJIAjmCaHnJL37Mgtp+88RpCyhPg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=JcYBrVli8Ad1oCawbWOz/nUF5yHmbXUIEriyFunV/BDMu05UgS54dVXy6j/YTjh56GSXw0fcz9aW46hOHRt4tRZ62L+wTnhN7XvcH9ZYSB4mG7d1oBiAwjkMUg5kX7aRY6A5TlacQoJEfMQdpqfdshsK4iQrMtscu64ZOn02TaA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com; spf=pass smtp.mailfrom=outlook.com; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b=WzmjLvDs; arc=fail smtp.client-ip=40.92.53.28 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="WzmjLvDs" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P0Zf0OVOEasabu4BZHk1ujSzsj0REVQcB2VV2ahoIX4ZNXU2eu/Y7dTGOSsICOa0LrXvbnUSuGspBrrSdXNE712swfq3oBvCxp5VJg0+4uhY2jjTV/GNPb28/DRKaZHu6wSvDcxEL+xvQbooM5efcn7+Aih3nHqiyDW4AMqhm3xR9gTvPQLQfSKk5ZBgF51hrF9xJLHtshhnezszQfubLb4FuXUhA9WvHR287aB2QPTTzu6EhmYC72xpGCR2GQn4gAPKuj9pDOruKo8Zww9Bdf70xqb6EDF3WjXLtqpy81WShuhowTO7IGVYpBgqO1cMEpjaACqQ8ltVY5iftGIrzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iQAkg9s38iV7LKj7Kma2OA4gmVrARWTRgWFnKRlnZQk=; b=ViozGUK6scX17uujFEGfK56JG8HXwQG4mzJoBX5XsZDmcZKT9rPRqOTKrHF8axy1qP4Oa06nX3VBtIlSL4ao/7BHSbn+q/N0E9reyAL3nUkBpgFaw5YsR7oGDZ8alia0wMUJLkT+Q13O/0Pk4QB/ARN2xF8G1PC4zIYiYJIv4tcDCtitj+PcRSo1yBw1m8MVnBWYCQAUG9hpb4cOaAkF2C5BFAlhb1xp5cydwVoJ6SBSL7pRHJwAPSIK/wBproHwwpqkV8KdLD5OCy/xG+nfF40gbP26C56wNffL9FnIU6KpnQuImItxhpBXHayC3j+MYQmm3UlNcBdufv3iBVXsng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iQAkg9s38iV7LKj7Kma2OA4gmVrARWTRgWFnKRlnZQk=; b=WzmjLvDsXV+Q00FSC2lkVRsnxZxU7SVGouezJD1xz/0TGl31iu6YlW0AXEsf+KcqTl2+jXlsLEtQCaSxetQ4GcebsFUTsci18cfZH4PMeI0toQ1EDZWw2uNL4tLJhzb7+NAxMqWX9uonJ4geGhMKpfwS0WgXT3pVQgVs1wJkIGXV34HghIp26hHJYU6hCm/OULoxsPF61ycVJn9u/pbrgCaaueLsiEGnjXvAGU/BHzzyBlTGHCyBtrbWfqIgthmbkeiW+njl14RI87+zWItipZ/ZsYuijPRuGicl62pDPimvw+LOogoP3N/9bPztn45k9XFz5lqPxCGll1RJ+z50sQ== Received: from PSAPR06MB4952.apcprd06.prod.outlook.com (2603:1096:301:a3::11) by KL1PR06MB6041.apcprd06.prod.outlook.com (2603:1096:820:cb::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 8 Apr 2024 03:36:40 +0000 Received: from PSAPR06MB4952.apcprd06.prod.outlook.com ([fe80::45cb:f62c:d9bc:b12b]) by PSAPR06MB4952.apcprd06.prod.outlook.com ([fe80::45cb:f62c:d9bc:b12b%7]) with mapi id 15.20.7409.053; Mon, 8 Apr 2024 03:36:40 +0000 From: Guanbing Huang To: gregkh@linuxfoundation.org, andriy.shevchenko@intel.com, rafael.j.wysocki@intel.com Cc: linux-acpi@vger.kernel.org, tony@atomide.com, john.ogness@linutronix.de, yangyicong@hisilicon.com, jirislaby@kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, lvjianmin@loongson.cn, albanhuang@tencent.com, tombinfan@tencent.com Subject: [PATCH v5 2/3] serial: port: Add support of PNP IRQ to __uart_read_properties() Date: Mon, 8 Apr 2024 11:36:23 +0800 Message-ID: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-TMN: [rzNVr0/+DzC9PN+ledG6BYbI7AXuQytv] X-ClientProxiedBy: SGXP274CA0001.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::13) To PSAPR06MB4952.apcprd06.prod.outlook.com (2603:1096:301:a3::11) X-Microsoft-Original-Message-ID: Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PSAPR06MB4952:EE_|KL1PR06MB6041:EE_ X-MS-Office365-Filtering-Correlation-Id: c692a7ec-a4be-4499-84ed-08dc577d1a2a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BYgK1D7upVtqU001q/Y46cCXxCAvL+uOBMpbbQD42VU9XktnBacxuwxWk0OH1RIjRZ7Goa1jl+CTHF0dU4dVZOdyk3QyWXee1nT36nNJmITwp7DfJQuHHLpQwMWC7Z1qOH0ztWxq/ApSzbREEIBJqqNNnsndqpXAwdT2839zNXqm5DhSFi6AKBukE0AtIgaZPRwNLQ0VnxS+vBnsL98+UJT+KcNfyr//SMdrW42e8a3EU2EWJ8k/4Sj6vaulJXDDKHvaP5kUBhArhLn2jDtsEXHCOIvYGARQEikr0NdeYNJ4P1z7a/C68POyd1KwaNcjIYu2//WvA1iPA449t1UopVihg1hGVQshy9s7bxAgAfI44+zGY+dy9Oqg2oO0Hwl0RDrQMAUhPZc/cNdU8KnZjM1/FYvZz4G3/UDwdhFr/lY+FiCxaEo00SIRiSG27MGfRzNdDnnm0o0J/Bi0oDhvXjPXOskT8iAsrwQAI79vMW7g+L5hT5agdkHpgES1QFd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H76aWhaTUMJsnOa8UPyMXIJG/lrRTSGPfvJCBuDeYcFUL2NjhsAqoYeMRh+rxMRchOzRD0z1EjJ4yMn3SHL67b2JqKSGHIa6mSxPG/nmhIHTXF2brxmantMGJrBj92384HYUnE2wCRpyJPHzfzWX2pAKz+6PWjYsQfDAxy99QTZREnzbj6C1yQ3RX3887Ze0XgAKD2MCDIHq1v0OQMo/hfOpih6TLj+KYCaL3ip1pTwX/Suob4bUcUOO80VKaXROZcdH9JGJfVqjUQqH61ZDBv3tqY6Q5Yxn5xC4= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c692a7ec-a4be-4499-84ed-08dc577d1a2a X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB4952.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2024 03:36:40.2727 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6041 From: Guanbing Huang The function __uart_read_properties doesn't cover PNP devices, so add IRQ processing for PNP devices in the branch. Signed-off-by: Guanbing Huang Suggested-by: Andy Shevchenko Reviewed-by: Bing Fan Tested-by: Linheng Du --- v4 -> v5: change "pnp" and "irq" in the commit message to uppercase, modify the subject to start with "serial: port:", modify the location of the header file pnp.h drivers/tty/serial/serial_port.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/serial_port.c b/drivers/tty/serial/serial_port.c index 22b9eeb23e68..8504bae1d2c9 100644 --- a/drivers/tty/serial/serial_port.c +++ b/drivers/tty/serial/serial_port.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -221,7 +222,11 @@ static int __uart_read_properties(struct uart_port *port, bool use_defaults) if (dev_is_platform(dev)) ret = platform_get_irq(to_platform_device(dev), 0); - else + else if (dev_is_pnp(dev)) { + ret = pnp_irq(to_pnp_dev(dev), 0); + if (ret < 0) + ret = -ENXIO; + } else ret = fwnode_irq_get(dev_fwnode(dev), 0); if (ret == -EPROBE_DEFER) return ret;