From patchwork Fri Mar 4 08:03:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12768692 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A580EC433F5 for ; Fri, 4 Mar 2022 08:08:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gM8+w6HRqVux70aeMQzZlHVFVwlOE/Q7MIngHXMnP7w=; b=jsrwIKuDb8tFOu SPlY5e95P6xqVy+F+HdR+qDtyXP+tFfCqDiY7UcEO6URanrDLocjcWcBJ5bZUpFwNdxLkLn24sdCp 5zcYYn4ifDWtt7uyax6K+51ydNZp6TckuoL6EZ9sPn6gD9E/adg9k1HOME76wAawnPLgZ+PtT0LJk WAagZOYMO7KvXs1B9ywZWr+6mABHV9f7X6rfHXHC6jXoDxQWsRRMXcYcWgR7NaO2nirR++tjEqayU 8i3nyNepbV7C2AdMcy7L1T5A+qSEH23MLga4sdzrsTsDy7bwadZLD2duMxef00NAJBWGOTuGWiYo8 5s324QjeVn0EYl3xoEvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nQ2xb-008vW6-QH; Fri, 04 Mar 2022 08:06:48 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nQ2v3-008uSU-2P for linux-arm-kernel@lists.infradead.org; Fri, 04 Mar 2022 08:04:12 +0000 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 63CFB3F600 for ; Fri, 4 Mar 2022 08:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646381047; bh=rlX9LT2Ku3zafWWNfSgPawKn9LilfNFaq1DtAqUhXpM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IM7SuxZipeNQoHHawU6CiA74eJTir1weyfXATGcjUgJLMrmM5iitcR2sIUVlpxwBW P7ZIEMzEdUhZuKHqHOevCOynGEAwAxmenDn4lpWGJZOitxp9XQE08LFlqtRRY+b5S9 v/iZkP9fSW4i3ORw5Q0CDLFMHLyX4lDWk40G1+Vu+O8EqIB0JMrTuF4nndEpw0tocb ZwJykDT8uiAC9v/J9VYI4JIkRrkKtXJN06kdzAC1ogf/iCHOSzJfDvs7MmpL8AsCFM keyiDoo11KcSPtGbblcmtQliYZYT71FVKtwa3Shq6XZ+itxti+qLFcmgJO/wGAAN3S ZHgtsqJL1a8cw== Received: by mail-ed1-f69.google.com with SMTP id y26-20020a50ce1a000000b00415e9b35c81so1963196edi.9 for ; Fri, 04 Mar 2022 00:04:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rlX9LT2Ku3zafWWNfSgPawKn9LilfNFaq1DtAqUhXpM=; b=jWrkkxV8AwnwEqX8ehUkpXyIT8kZ7MAJ1YHFwnkUjMMIyVRspbtgYwQia+uwLRyD+v yImZ1GoR/7OshG4MSTI5xk7CuWsNepxDSdCVgy1JwsHEYajf1m4+aLcVG+JDzJTMsTTY a3PVjCylNxhU0CER7XGRgu7i5D8OV3ZCpkwvprWi8C/VTk1Q833jxe7iJ+3goCePLxGD eB4nxdkMm/Swb1X+NJzfCw98WT/D+OWnDJMiLR245b5qHBrlxApMUzXad/t+5pz0rqiy MaLBgtXxEcuPeCOETqPc6s1fjYzHKIvr35bWsn3rXcmL1B8RNCeIbyAxYl6ZZArsF07G 7y5A== X-Gm-Message-State: AOAM530JVcPtVzGMEswua0Wj5LItei43G/nz6lwEDUUSXubH9uSJPJf7 h50pHzra8eFtxKf7BOKDGl88zLFoK/D3Ph1yzbfYKeC0xsIRDWLMOmdkqhYz2sC7WJCmqdhVwhA x8mHe2mEKJaI6ogQmKNSZ7j23N94L6CieUue1uPB3bWWXkljTgQME X-Received: by 2002:a17:906:434e:b0:6d0:ed9c:68bc with SMTP id z14-20020a170906434e00b006d0ed9c68bcmr29023908ejm.70.1646381047109; Fri, 04 Mar 2022 00:04:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9NTQ5aaCe/mw4aEV5jifd4tz1CDgIbNknK5DSvctYEEFyUW63B8TVoeIxQGRv9fsptQj8Sw== X-Received: by 2002:a17:906:434e:b0:6d0:ed9c:68bc with SMTP id z14-20020a170906434e00b006d0ed9c68bcmr29023896ejm.70.1646381046879; Fri, 04 Mar 2022 00:04:06 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-181-108.adslplus.ch. [188.155.181.108]) by smtp.gmail.com with ESMTPSA id rv11-20020a17090710cb00b006d5c0cd5e0dsm1481465ejb.82.2022.03.04.00.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 00:04:06 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/7] tty: serial: samsung: simplify getting OF match data Date: Fri, 4 Mar 2022 09:03:48 +0100 Message-Id: <20220304080348.218581-7-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220304080348.218581-1-krzysztof.kozlowski@canonical.com> References: <20220304080348.218581-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220304_000409_310865_1AE6DE03 X-CRM114-Status: GOOD ( 13.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Simplify the code with of_device_get_match_data(). Signed-off-by: Krzysztof Kozlowski --- drivers/tty/serial/samsung_tty.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 00e7c34fad46..76f7afd1b7f7 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2150,23 +2150,16 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, /* Device driver serial port probe */ -#ifdef CONFIG_OF -static const struct of_device_id s3c24xx_uart_dt_match[]; -#endif - static int probe_index; static inline const struct s3c24xx_serial_drv_data * s3c24xx_get_driver_data(struct platform_device *pdev) { #ifdef CONFIG_OF - if (pdev->dev.of_node) { - const struct of_device_id *match; - - match = of_match_node(s3c24xx_uart_dt_match, pdev->dev.of_node); - return (struct s3c24xx_serial_drv_data *)match->data; - } + if (pdev->dev.of_node) + return of_device_get_match_data(&pdev->dev); #endif + return (struct s3c24xx_serial_drv_data *) platform_get_device_id(pdev)->driver_data; }