From patchwork Fri Jul 9 06:57:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12366855 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CEA90C11F68 for ; Fri, 9 Jul 2021 06:57:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B604E61245 for ; Fri, 9 Jul 2021 06:57:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231265AbhGIHAg (ORCPT ); Fri, 9 Jul 2021 03:00:36 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:38035 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230494AbhGIHAe (ORCPT ); Fri, 9 Jul 2021 03:00:34 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20210709065749epoutp04f99ef2ff568a6a882b55fe6c232592fc~QDRnBPSy51010810108epoutp04g for ; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20210709065749epoutp04f99ef2ff568a6a882b55fe6c232592fc~QDRnBPSy51010810108epoutp04g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813869; bh=zU6c2IkKZlJdDlUWUDmg7+H7g+or8OGwvfpPyh/1+jc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bgJQwOog3hZezaOwKx4WC13Bx8FNXAdD3acHC3KsPQgxp4VLgNJZ26K1t8l/jUV6Z /XTD8qzdwYXVFvgEs3dNw4LpTmIrORR3BQJ8qcqzTNEN9IWf2xBEQAPoxb90vFc+oL 0vCfJHsuw1K3h3Ee8wp6H2tMmucMZ2L6wvaRuE74= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20210709065748epcas2p19ac771b1d502fe473dcb061b2538d7cb~QDRl399js0581505815epcas2p1y; Fri, 9 Jul 2021 06:57:48 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.183]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4GLkWH0SPqz4x9QL; Fri, 9 Jul 2021 06:57:47 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id D7.D4.09541.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epcas2p26f07099abcb946400ff2777fd9df975d~QDRj75odZ2550225502epcas2p2H; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210709065746epsmtrp1bc4578793672c53acf62df32e5923af1~QDRj68AdQ3179431794epsmtrp1P; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) X-AuditID: b6c32a46-095ff70000002545-62-60e7f36ad0da Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id DE.B7.08289.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip27683dec1acd43a88a19fd291612147f5~QDRjuLhML3134631346epsmtip2v; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 04/15] scsi: ufs: ufs-exynos: simplify drv_data retrieval Date: Fri, 9 Jul 2021 15:57:00 +0900 Message-Id: <20210709065711.25195-5-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Tf0xbVRT2vldeH2jZozB3xzKpT40OUtY2Ft6wbC782GNggoEQY2baJzwL s7RdW4zTLNawAQOBbgobxSGisq3YNbKusGUM6HBI5xxLmQKbBBbkl5IBNUMw22x5XeS/75zz ffec79x7cVTowaLxIq2JNWgZDYmF8VxXt8nF+33TKonDnUQNTH6PUeNNLoyaXbmNUfULKyi1 5GgNobzdcdRnF1Oo65YWhJp0WFGqZdiFUGd/pagR54886uTNKwhV9VsnRp3uf4S8voH2DmXS 3ppqhD5/Jpb+5vIsQrfbjmK0paUH0It/jPLoGqcN0L725+jyniokO+xtjaKQZQpYg4jV5usK irTqZDIzR5milCdIpGLpDiqRFGmZYjaZTM3KFqcXafwWSNEHjKbEn8pmjEZy+06FQVdiYkWF OqMpmWT1BRq9VKqPNzLFxhKtOj5fV5wklUhkcj9TpSl0278G+qaID4dWf+CbQUd4JQjFIfEq vNVYi1SCMFxIdAL49/QIxgVLADrqu9AAS0j4AByawJ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NrI3sC4na+LkZNDQsBEom/7 ReYuRi4OIYEdjBInF15mg0jISjx7t4MdwhaWuN9yhBWi6D2jxLXbcxlBEmwCuhJbnr8Cs0UE JjJKLLknBlLELHCZWeLbtCvMIAlhAU+JyxPOAk3i4GARUJXY99ANJMwrYCexedYLqAXyEqeW HWQCsTkF7CXm/ZgAZgsB1dzbsI8dol5Q4uTMJywgNjNQffPW2cwTGAVmIUnNQpJawMi0ilEy taA4Nz232LDAKC+1XK84Mbe4NC9dLzk/dxMjOJ60tHYw7ln1Qe8QIxMH4yFGCQ5mJRFeoxnP EoR4UxIrq1KL8uOLSnNSiw8xSnOwKInzXug6GS8kkJ5YkpqdmlqQWgSTZeLglGpgmqLYUf36 8+9TpTuFlmRdqfg8g3WadVaijU9w3PVcdf/v/iF7Zrq+LGv+aRd3kvdk8OGP93e5TLq4ZndK 0gT9x2b3/5d15bezCUwTzbBpZfuSLn5sUimv60mV6JojvQy/Nx1k/1D+dYZhX87CZ8/6LKa1 stu3XMtk/sckf2aDTef7SuFvAdI+f7m3hp5fYNW4vLbmRUOFROwTQ7ugVV1p0Vefmfj4H99s prO9dm+FVeqjHXJ77eS31ovpXJzU8aTebWbC9pouv1PXG++vfae5+I2Wi/htxVOvQhRvzv/X 2fO459HeM4fS5+az2iddbri1+o3bcr5runreBSe5xZxrexcyvvbR/Lo1f/9Wp+WKSizFGYmG WsxFxYkAM9um+hYDAAA= X-CMS-MailID: 20210709065746epcas2p26f07099abcb946400ff2777fd9df975d X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065746epcas2p26f07099abcb946400ff2777fd9df975d References: <20210709065711.25195-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The compatible field of exynos_ufs_drv_data is not necessary because of_device_id already has it. Thus, we don't need it anymore and we can get drv_data by device_get_match_data. Signed-off-by: Chanho Park Reviewed-by: Alim Akhtar --- drivers/scsi/ufs/ufs-exynos.c | 10 +--------- drivers/scsi/ufs/ufs-exynos.h | 3 +-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index cf46d6f86e0e..db5892901cc0 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -893,17 +893,10 @@ static int exynos_ufs_post_link(struct ufs_hba *hba) static int exynos_ufs_parse_dt(struct device *dev, struct exynos_ufs *ufs) { struct device_node *np = dev->of_node; - struct exynos_ufs_drv_data *drv_data = &exynos_ufs_drvs; struct exynos_ufs_uic_attr *attr; int ret = 0; - while (drv_data->compatible) { - if (of_device_is_compatible(np, drv_data->compatible)) { - ufs->drv_data = drv_data; - break; - } - drv_data++; - } + ufs->drv_data = device_get_match_data(dev); if (ufs->drv_data && ufs->drv_data->uic_attr) { attr = ufs->drv_data->uic_attr; @@ -1258,7 +1251,6 @@ static struct exynos_ufs_uic_attr exynos7_uic_attr = { }; static struct exynos_ufs_drv_data exynos_ufs_drvs = { - .compatible = "samsung,exynos7-ufs", .uic_attr = &exynos7_uic_attr, .quirks = UFSHCD_QUIRK_PRDT_BYTE_GRAN | UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR | diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h index 475a5adf0f8b..7bf2053f6e90 100644 --- a/drivers/scsi/ufs/ufs-exynos.h +++ b/drivers/scsi/ufs/ufs-exynos.h @@ -142,7 +142,6 @@ struct exynos_ufs_uic_attr { }; struct exynos_ufs_drv_data { - char *compatible; struct exynos_ufs_uic_attr *uic_attr; unsigned int quirks; unsigned int opts; @@ -191,7 +190,7 @@ struct exynos_ufs { struct ufs_pa_layer_attr dev_req_params; struct ufs_phy_time_cfg t_cfg; ktime_t entry_hibern8_t; - struct exynos_ufs_drv_data *drv_data; + const struct exynos_ufs_drv_data *drv_data; u32 opts; #define EXYNOS_UFS_OPT_HAS_APB_CLK_CTRL BIT(0)