Commit 3f06f780 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: ufs: Minimize #include directives

Follow the convention that is used elsewhere in the Linux kernel source
code and only include those headers of which the declarations are used
directly.

Link: https://lore.kernel.org/r/20220419225811.4127248-26-bvanassche@acm.orgTested-by: default avatarBean Huo <beanhuo@micron.com>
Reviewed-by: default avatarBean Huo <beanhuo@micron.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent cff91daf
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
* *
*/ */
#include <linux/clk.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "ufshcd-dwc.h" #include "ufshcd-dwc.h"
#include "tc-dwc-g210.h" #include "tc-dwc-g210.h"
#include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/pm_runtime.h>
#include "ufshcd-pltfrm.h" #include "ufshcd-pltfrm.h"
#include "ufshcd-dwc.h" #include "ufshcd-dwc.h"
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* Authors: Joao Pinto <jpinto@synopsys.com> * Authors: Joao Pinto <jpinto@synopsys.com>
*/ */
#include <linux/module.h>
#include "ufshcd.h" #include "ufshcd.h"
#include "unipro.h" #include "unipro.h"
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#ifndef _TC_DWC_G210_H #ifndef _TC_DWC_G210_H
#define _TC_DWC_G210_H #define _TC_DWC_G210_H
struct ufs_hba;
int tc_dwc_g210_config_40_bit(struct ufs_hba *hba); int tc_dwc_g210_config_40_bit(struct ufs_hba *hba);
int tc_dwc_g210_config_20_bit(struct ufs_hba *hba); int tc_dwc_g210_config_20_bit(struct ufs_hba *hba);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/delay.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
*/ */
#include <linux/time.h> #include <linux/time.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
#include <linux/arm-smccc.h> #include <linux/arm-smccc.h>
#include <linux/bitfield.h> #include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/of_device.h> #include <linux/of_device.h>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
* Copyright 2019 Google LLC * Copyright 2019 Google LLC
*/ */
#include <linux/delay.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/qcom_scm.h> #include <linux/qcom_scm.h>
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/phy/phy.h> #include <linux/phy/phy.h>
...@@ -18,6 +21,7 @@ ...@@ -18,6 +21,7 @@
#include "ufs-qcom.h" #include "ufs-qcom.h"
#include "ufshci.h" #include "ufshci.h"
#include "ufs_quirks.h" #include "ufs_quirks.h"
#define UFS_QCOM_DEFAULT_DBG_PRINT_EN \ #define UFS_QCOM_DEFAULT_DBG_PRINT_EN \
(UFS_QCOM_DBG_PRINT_REGS_EN | UFS_QCOM_DBG_PRINT_TEST_BUS_EN) (UFS_QCOM_DBG_PRINT_REGS_EN | UFS_QCOM_DBG_PRINT_TEST_BUS_EN)
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "ufs.h" #include "ufs.h"
#include "ufs-sysfs.h" #include "ufs-sysfs.h"
#include "ufshcd.h"
static const char *ufshcd_uic_link_state_to_string( static const char *ufshcd_uic_link_state_to_string(
enum uic_link_state state) enum uic_link_state state)
......
...@@ -7,11 +7,12 @@ ...@@ -7,11 +7,12 @@
#include <linux/sysfs.h> #include <linux/sysfs.h>
#include "ufshcd.h" struct device;
void ufs_sysfs_add_nodes(struct device *dev); void ufs_sysfs_add_nodes(struct device *dev);
void ufs_sysfs_remove_nodes(struct device *dev); void ufs_sysfs_remove_nodes(struct device *dev);
extern const struct attribute_group ufs_sysfs_unit_descriptor_group; extern const struct attribute_group ufs_sysfs_unit_descriptor_group;
extern const struct attribute_group ufs_sysfs_lun_attributes_group; extern const struct attribute_group ufs_sysfs_lun_attributes_group;
#endif #endif
...@@ -4,7 +4,12 @@ ...@@ -4,7 +4,12 @@
* *
* Copyright (C) 2018 Western Digital Corporation * Copyright (C) 2018 Western Digital Corporation
*/ */
#include <linux/bsg-lib.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include "ufs_bsg.h" #include "ufs_bsg.h"
#include "ufshcd.h"
static int ufs_bsg_get_query_desc_size(struct ufs_hba *hba, int *desc_len, static int ufs_bsg_get_query_desc_size(struct ufs_hba *hba, int *desc_len,
struct utp_upiu_query *qr) struct utp_upiu_query *qr)
......
...@@ -5,12 +5,7 @@ ...@@ -5,12 +5,7 @@
#ifndef UFS_BSG_H #ifndef UFS_BSG_H
#define UFS_BSG_H #define UFS_BSG_H
#include <linux/bsg-lib.h> struct ufs_hba;
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include "ufshcd.h"
#include "ufs.h"
#ifdef CONFIG_SCSI_UFS_BSG #ifdef CONFIG_SCSI_UFS_BSG
void ufs_bsg_remove(struct ufs_hba *hba); void ufs_bsg_remove(struct ufs_hba *hba);
......
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
#ifndef _UFSHCD_CRYPTO_H #ifndef _UFSHCD_CRYPTO_H
#define _UFSHCD_CRYPTO_H #define _UFSHCD_CRYPTO_H
#ifdef CONFIG_SCSI_UFS_CRYPTO #include <scsi/scsi_cmnd.h>
#include "ufshcd.h" #include "ufshcd.h"
#include "ufshci.h"
#ifdef CONFIG_SCSI_UFS_CRYPTO
static inline void ufshcd_prepare_lrbp_crypto(struct request *rq, static inline void ufshcd_prepare_lrbp_crypto(struct request *rq,
struct ufshcd_lrb *lrbp) struct ufshcd_lrb *lrbp)
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* Authors: Joao Pinto <jpinto@synopsys.com> * Authors: Joao Pinto <jpinto@synopsys.com>
*/ */
#include <linux/module.h>
#include "ufshcd.h" #include "ufshcd.h"
#include "unipro.h" #include "unipro.h"
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#ifndef _UFSHCD_DWC_H #ifndef _UFSHCD_DWC_H
#define _UFSHCD_DWC_H #define _UFSHCD_DWC_H
#include "ufshcd.h"
struct ufshcd_dme_attr_val { struct ufshcd_dme_attr_val {
u32 attr_sel; u32 attr_sel;
u32 mib_val; u32 mib_val;
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
*/ */
#include "ufshcd.h" #include "ufshcd.h"
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/pm_qos.h> #include <linux/pm_qos.h>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* Vinayak Holikatti <h.vinayak@samsung.com> * Vinayak Holikatti <h.vinayak@samsung.com>
*/ */
#include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/of.h> #include <linux/of.h>
......
...@@ -16,7 +16,16 @@ ...@@ -16,7 +16,16 @@
#include <linux/bitfield.h> #include <linux/bitfield.h>
#include <linux/blk-pm.h> #include <linux/blk-pm.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/nls.h>
#include <linux/regulator/consumer.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_dbg.h>
#include <scsi/scsi_driver.h> #include <scsi/scsi_driver.h>
#include <scsi/scsi_eh.h>
#include "ufshcd.h" #include "ufshcd.h"
#include "ufs_quirks.h" #include "ufs_quirks.h"
#include "unipro.h" #include "unipro.h"
......
...@@ -12,38 +12,13 @@ ...@@ -12,38 +12,13 @@
#ifndef _UFSHCD_H #ifndef _UFSHCD_H
#define _UFSHCD_H #define _UFSHCD_H
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/rwsem.h>
#include <linux/workqueue.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/wait.h>
#include <linux/bitops.h>
#include <linux/pm_runtime.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/regulator/consumer.h>
#include <linux/bitfield.h> #include <linux/bitfield.h>
#include <linux/devfreq.h>
#include <linux/blk-crypto-profile.h> #include <linux/blk-crypto-profile.h>
#include <linux/blk-mq.h>
#include <linux/devfreq.h>
#include <linux/pm_runtime.h>
#include <scsi/scsi_device.h>
#include "unipro.h" #include "unipro.h"
#include <asm/irq.h>
#include <asm/byteorder.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_dbg.h>
#include <scsi/scsi_eh.h>
#include "ufs.h" #include "ufs.h"
#include "ufs_quirks.h" #include "ufs_quirks.h"
#include "ufshci.h" #include "ufshci.h"
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#ifndef _UFSHCI_H #ifndef _UFSHCI_H
#define _UFSHCI_H #define _UFSHCI_H
#include <scsi/scsi_host.h>
enum { enum {
TASK_REQ_UPIU_SIZE_DWORDS = 8, TASK_REQ_UPIU_SIZE_DWORDS = 8,
TASK_RSP_UPIU_SIZE_DWORDS = 8, TASK_RSP_UPIU_SIZE_DWORDS = 8,
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
*/ */
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/module.h>
#include <scsi/scsi_cmnd.h>
#include "ufshcd.h" #include "ufshcd.h"
#include "ufshpb.h" #include "ufshpb.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment