From patchwork Tue Mar 8 08:09:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12773237 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 190B9C433F5 for ; Tue, 8 Mar 2022 08:13:37 +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:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yqXU6l//+VrR1Q+uh4c/rf/ojYzjGNqQiZV6ZEDqccQ=; b=FkrZQjo4047IYa 0Jn8HHfp6RbbcgOVh1B3fANAjmBo595xf044pYBrZ2JhGKSsCwK6DulAdWCKQfrawG6qAr4KZik12 I0r2280BRYRkw7DZEl6DKQ8kNPSwasO/w9FSiqKVVa0/TmhRVttZ0F/xfPh+TR683nNOCnwromwQ/ Bi9xU/6l42Wb7Vn7XqcS1VlrJcpQLdF1FZJ0QtevBV6FuGpbLdbG36z9J1WgIh06fEPCsr9iuJoSS CHgN0OSyEVS8N4X3jWxL8Z4rtnN6oIhGPFw5txYmgUMom/JAmPiFIL7mWtuEQZ2TRDUY3LJEWLKi8 t2zFfAqDCySA6gfR5mzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUwp-003BC3-9O; Tue, 08 Mar 2022 08:12:00 +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 1nRUuW-0039za-5a for linux-arm-kernel@lists.infradead.org; Tue, 08 Mar 2022 08:09:37 +0000 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (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 92A6D3F605 for ; Tue, 8 Mar 2022 08:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646726973; bh=HBWgDosMAxuyNUJy93OLxsRzmckdD8hfFxFfwNDa3dk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gTeTFmNS5aebL7Hy7XLUm1mOhREgd7O3FVcgt1QYGhKZYxSTk0tWAjT/Uu5uryPoA WfdfSRFLipFl72xbXy1CV/QECMhWfStoQmy7CNGuIwk+yQOErXny4Imvz3QGPnBHbx HyTpYRFchYhuptwz8ri0GRWC9tGz0wRtIjclmAX0IzcLfNcgEYuhzwfbcxIosOOdv4 1p8odZsdwLxL7rJ1VoVq7ebhArOygBHhCtyh0p1wsLYviFJA5doITv0KvV9In/G0G3 btbNnnZXOYSoB9ikn2gfUfEC6xamK8/kZhGqJTcsTGfcS/bb3GpbzhIeqWjqcWaPKY lRR3IRG8dbuBQ== Received: by mail-ej1-f72.google.com with SMTP id k16-20020a17090632d000b006ae1cdb0f07so8255315ejk.16 for ; Tue, 08 Mar 2022 00:09:33 -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:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HBWgDosMAxuyNUJy93OLxsRzmckdD8hfFxFfwNDa3dk=; b=DhPO5hSinl28bVJlrJsmERd4yfxzKsBSno6Fj243u+fBVVBf2Mgt+SP58a9YZX2sa8 IdgBgnpaOuBhP+Ig5bzGKpwpSoWSvKv2l8uX4aeVGEULKgEYOdJ5DB0ZSJnzrzv6KzMn HQwPyi3OgNEIUxhRE8nn0ofZQs4CFi1P4pcVTp66hEeqKrqS7JW5IN6FpdhBd4sCsMZt GtVBkCSdZuwpB3iUGTHQI7HUK3GsR4/Ye5PmTwB77chlH8znM8rLpJzlGz4/f2ek7aKR /nv75wKODg4LNRB2PnPNDpEZM2E/vKw3Tz9k+bQdRhSTg+RKkio4IbqdGoEUmoO1OcNr 2koA== X-Gm-Message-State: AOAM531jZHJE0W6lRHLZ6wx8utk8VbKz2s7UBrisSdJLlz4HtOHZaW3D AAIybUERRVrsKFZul55v0G5Qu7NzD9LWeyTTE9xZrJBBqZlWg3UTldn2SfLoujoPuwBMYGtWi7t cHH6HbH40Ag/0ubwyH1T1yM+5tPrYab+WXGZsl5AGrTvL3MYqUnQh X-Received: by 2002:a05:6402:3582:b0:416:6d78:c693 with SMTP id y2-20020a056402358200b004166d78c693mr1885060edc.24.1646726973208; Tue, 08 Mar 2022 00:09:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwX4vanJVIXL0r2uldoJOauafSu6vD8LH4bQI9ff/g3MAlWaGOGZ5yN4YqE3lb73p272nAkog== X-Received: by 2002:a05:6402:3582:b0:416:6d78:c693 with SMTP id y2-20020a056402358200b004166d78c693mr1885050edc.24.1646726973053; Tue, 08 Mar 2022 00:09:33 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id t4-20020a056402524400b00415b90801edsm7385697edd.57.2022.03.08.00.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:09:32 -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 Cc: Andy Shevchenko Subject: [PATCH v3 8/8] tty: serial: samsung: simplify getting OF match data Date: Tue, 8 Mar 2022 09:09:19 +0100 Message-Id: <20220308080919.152715-9-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> References: <20220308080919.152715-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-20220308_000936_395333_C2E9895D X-CRM114-Status: GOOD ( 14.55 ) 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() and use dev_of_node() to remove ifdef-erry. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar --- drivers/tty/serial/samsung_tty.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 3ffae912217c..74d466cc4152 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2150,23 +2150,14 @@ 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; + if (dev_of_node(&pdev->dev)) + return of_device_get_match_data(&pdev->dev); - match = of_match_node(s3c24xx_uart_dt_match, pdev->dev.of_node); - return (struct s3c24xx_serial_drv_data *)match->data; - } -#endif return (struct s3c24xx_serial_drv_data *) platform_get_device_id(pdev)->driver_data; }