From patchwork Mon Mar 7 08:09:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12771343 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 D0D9BC433EF for ; Mon, 7 Mar 2022 08:12:21 +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=HBiKhGvNGKA3fD+4h34awAaOdSx9YsnSFqVYCRgWhtM=; b=UHrG7xJiHPUfob zp5NyQRQ5z04Pc19OX3kyMD8dmPFYcaDOXITlx44blhE3pQGZvQxgZnCrIwKH2753LZq4x1kLTi6V FXmrlK4ExlgQu357EDIFBCDSIOLVnJU53RLlTWCA8B6cfIHrRRcffEKSE5oSkPMNmpKKUuQCpqcCD SANh76u82T0WFRvRHrHI0zMb526llK8bc0s35Vh6b8K/AmNZAzxDcOqiiwgLoky1T/Rto3Fmf4dYA /wfny+TfApNC4KfeK+DwMx2QPcQAdXbso2tMIbbA3HFJ4WwEGVJYvdTGtiNvynfvymNj8ncvpAaqE yFDvTKA2i2LjRdWGbf5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8S9-00GP6l-AS; Mon, 07 Mar 2022 08:10:49 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nR8Qz-00GOYJ-Mj for linux-arm-kernel@lists.infradead.org; Mon, 07 Mar 2022 08:09:39 +0000 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (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-1.canonical.com (Postfix) with ESMTPS id 701323F600 for ; Mon, 7 Mar 2022 08:09:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646640576; bh=qtWe8unaq2gnuH4T5GX8K7Uz0Sk1ucH1nG+ntQuiss8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vCZaSo1HP8djnJ+LH5Lx3pkLoOhvUtkLFtEDhFoQ5cKORlhX/0N0fWBvLTIzq8rgM gPqo6Nbdjd4lABJS06JS61XylDcav1BzryOvPEOjsQD5lA8zVF4NKlC7K2rPdnz4Su mxVC1nKbsKlBTBxU1BS3vuOO1f40y9bMt7mWU7tTf8wJJDSrYIrOQ3fOGQhGoD+8f4 z+caJltrlKf8jXuIbhjETqcC/kNe26g/ao0nqyQD6n0osFVmhxyouHQjOScUs9aWJ+ lbz/ZSusQVGWtv8pDaSCt5G6bevUIo3ZaelC7CSv8JOpQLqTmRcIp8sDQ+AFf2wnJV 0siCYGTsbhWgQ== Received: by mail-ej1-f71.google.com with SMTP id r18-20020a17090609d200b006a6e943d09eso6580981eje.20 for ; Mon, 07 Mar 2022 00:09:36 -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=qtWe8unaq2gnuH4T5GX8K7Uz0Sk1ucH1nG+ntQuiss8=; b=3u0em11SOt/byMYbOZ30zItfxr6QLwjSv6OTX6HnMb7+K1kiPTx4YHG/gLNjagajS8 o1mk4YST4FYT8Wz6K8ED+7takAPw3EhXTbinm3jvTUlL5nTN1b8+IJpyuOmG5q0Qa+WR iKPbb2k2CHi0V/AV9lsZuIwUtt3KKV++uEOe3iXKQuvba2fxgJvJdxfHPsFWZAargILu gr0NnT3bCNFvaQEpO6y7MeBl6QrrJgPgyKgPYUFCGLZLG+mljbxIn0PSqCxaInXW2Hj0 UmdFya80NqMa4iD1IfaQSbyjT8mxfD1wZUzeRmDaxp5GFTEmSAesbhOR/oEOnpd/BWF8 c3yw== X-Gm-Message-State: AOAM531rfOus/mFdyXzrTTOqD2zJ8oTF4G9G2MdM2arDvCE+MO9qk2q2 jVs6lmznr/VFaTxYP1yT4na4bBKZ9MFcr8Zyk58twjvKhCoYeUA3flhTMNFEbH2KH17EVcRYgxY 9AwnBb4NIiEG4Jg97iuq0Tj4oS6wlCtKoy5n3mkFDongfuaobpDK1 X-Received: by 2002:a50:9505:0:b0:416:4496:5ec4 with SMTP id u5-20020a509505000000b0041644965ec4mr4323943eda.309.1646640575279; Mon, 07 Mar 2022 00:09:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2xIp5JRTTzEh0b9kN02MCecpWBHOKgNZ/2vrmHcEo1ZMQRcV8NeBt353n0K2lxOS7+4TSFw== X-Received: by 2002:a50:9505:0:b0:416:4496:5ec4 with SMTP id u5-20020a509505000000b0041644965ec4mr4323929eda.309.1646640575081; Mon, 07 Mar 2022 00:09:35 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id fq14-20020a1709069d8e00b006da650af5a9sm4472594ejc.3.2022.03.07.00.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 00:09:34 -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 v2 7/7] tty: serial: samsung: simplify getting OF match data Date: Mon, 7 Mar 2022 09:09:25 +0100 Message-Id: <20220307080925.54131-6-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> References: <20220307080810.53847-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-20220307_000937_932790_AE45D319 X-CRM114-Status: GOOD ( 14.08 ) 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 Reviewed-by: Alim Akhtar --- 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 3ffae912217c..61c530bb377f 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; }