diff options
| author | Nava kishore Manne <nava.manne@xilinx.com> | 2017-07-28 09:17:26 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-28 11:04:47 -0400 |
| commit | 5cb95fae7a326f164751782114981e48bf284258 (patch) | |
| tree | cad291854acb6fae289a8e8337e4c9be18be5d87 /drivers/char | |
| parent | ef2b56df5a8abd4036a19870b93ac9f0b1514573 (diff) | |
char: xilinx_hwicap: Fix warnings in the driver
This patch fixes the below warning
--> Use #include <linux/io.h> instead of <asm/io.h>
--> Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
--> please, no space before tabs
--> Block comments use a trailing */ on a separate line
--> Possible unnecessary 'out of memory' message
--> Block comments use * on subsequent lines
--> Block comments use a trailing */ on a separate line
--> braces {} are not necessary for any arm of this statement
--> DT compatible string "xlnx,opb-hwicap-1.00.b"
appears un-documented
--> DT compatible string "xlnx,xps-hwicap-1.00.a"
appears un-documented
Signed-off-by: Nava kishore Manne <navam@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
| -rw-r--r-- | drivers/char/xilinx_hwicap/xilinx_hwicap.c | 35 | ||||
| -rw-r--r-- | drivers/char/xilinx_hwicap/xilinx_hwicap.h | 6 |
2 files changed, 21 insertions, 20 deletions
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c index 5e5c8ee23a5b..067396bedf22 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c | |||
| @@ -86,8 +86,7 @@ | |||
| 86 | #include <linux/cdev.h> | 86 | #include <linux/cdev.h> |
| 87 | #include <linux/platform_device.h> | 87 | #include <linux/platform_device.h> |
| 88 | #include <linux/slab.h> | 88 | #include <linux/slab.h> |
| 89 | 89 | #include <linux/io.h> | |
| 90 | #include <asm/io.h> | ||
| 91 | #include <linux/uaccess.h> | 90 | #include <linux/uaccess.h> |
| 92 | 91 | ||
| 93 | #ifdef CONFIG_OF | 92 | #ifdef CONFIG_OF |
| @@ -253,8 +252,8 @@ static int hwicap_command_desync(struct hwicap_drvdata *drvdata) | |||
| 253 | * hwicap_get_configuration_register - Query a configuration register. | 252 | * hwicap_get_configuration_register - Query a configuration register. |
| 254 | * @drvdata: a pointer to the drvdata. | 253 | * @drvdata: a pointer to the drvdata. |
| 255 | * @reg: a constant which represents the configuration | 254 | * @reg: a constant which represents the configuration |
| 256 | * register value to be returned. | 255 | * register value to be returned. |
| 257 | * Examples: XHI_IDCODE, XHI_FLR. | 256 | * Examples: XHI_IDCODE, XHI_FLR. |
| 258 | * @reg_data: returns the value of the register. | 257 | * @reg_data: returns the value of the register. |
| 259 | * | 258 | * |
| 260 | * Returns: '0' on success and failure value on error | 259 | * Returns: '0' on success and failure value on error |
| @@ -324,7 +323,8 @@ static int hwicap_initialize_hwicap(struct hwicap_drvdata *drvdata) | |||
| 324 | dev_dbg(drvdata->dev, "initializing\n"); | 323 | dev_dbg(drvdata->dev, "initializing\n"); |
| 325 | 324 | ||
| 326 | /* Abort any current transaction, to make sure we have the | 325 | /* Abort any current transaction, to make sure we have the |
| 327 | * ICAP in a good state. */ | 326 | * ICAP in a good state. |
| 327 | */ | ||
| 328 | dev_dbg(drvdata->dev, "Reset...\n"); | 328 | dev_dbg(drvdata->dev, "Reset...\n"); |
| 329 | drvdata->config->reset(drvdata); | 329 | drvdata->config->reset(drvdata); |
| 330 | 330 | ||
| @@ -636,7 +636,6 @@ static int hwicap_setup(struct device *dev, int id, | |||
| 636 | 636 | ||
| 637 | drvdata = kzalloc(sizeof(struct hwicap_drvdata), GFP_KERNEL); | 637 | drvdata = kzalloc(sizeof(struct hwicap_drvdata), GFP_KERNEL); |
| 638 | if (!drvdata) { | 638 | if (!drvdata) { |
| 639 | dev_err(dev, "Couldn't allocate device private record\n"); | ||
| 640 | retval = -ENOMEM; | 639 | retval = -ENOMEM; |
| 641 | goto failed0; | 640 | goto failed0; |
| 642 | } | 641 | } |
| @@ -763,20 +762,20 @@ static int hwicap_of_probe(struct platform_device *op, | |||
| 763 | id = of_get_property(op->dev.of_node, "port-number", NULL); | 762 | id = of_get_property(op->dev.of_node, "port-number", NULL); |
| 764 | 763 | ||
| 765 | /* It's most likely that we're using V4, if the family is not | 764 | /* It's most likely that we're using V4, if the family is not |
| 766 | specified */ | 765 | * specified |
| 766 | */ | ||
| 767 | regs = &v4_config_registers; | 767 | regs = &v4_config_registers; |
| 768 | family = of_get_property(op->dev.of_node, "xlnx,family", NULL); | 768 | family = of_get_property(op->dev.of_node, "xlnx,family", NULL); |
| 769 | 769 | ||
| 770 | if (family) { | 770 | if (family) { |
| 771 | if (!strcmp(family, "virtex2p")) { | 771 | if (!strcmp(family, "virtex2p")) |
| 772 | regs = &v2_config_registers; | 772 | regs = &v2_config_registers; |
| 773 | } else if (!strcmp(family, "virtex4")) { | 773 | else if (!strcmp(family, "virtex4")) |
| 774 | regs = &v4_config_registers; | 774 | regs = &v4_config_registers; |
| 775 | } else if (!strcmp(family, "virtex5")) { | 775 | else if (!strcmp(family, "virtex5")) |
| 776 | regs = &v5_config_registers; | 776 | regs = &v5_config_registers; |
| 777 | } else if (!strcmp(family, "virtex6")) { | 777 | else if (!strcmp(family, "virtex6")) |
| 778 | regs = &v6_config_registers; | 778 | regs = &v6_config_registers; |
| 779 | } | ||
| 780 | } | 779 | } |
| 781 | return hwicap_setup(&op->dev, id ? *id : -1, &res, config, | 780 | return hwicap_setup(&op->dev, id ? *id : -1, &res, config, |
| 782 | regs); | 781 | regs); |
| @@ -806,20 +805,20 @@ static int hwicap_drv_probe(struct platform_device *pdev) | |||
| 806 | return -ENODEV; | 805 | return -ENODEV; |
| 807 | 806 | ||
| 808 | /* It's most likely that we're using V4, if the family is not | 807 | /* It's most likely that we're using V4, if the family is not |
| 809 | specified */ | 808 | * specified |
| 809 | */ | ||
| 810 | regs = &v4_config_registers; | 810 | regs = &v4_config_registers; |
| 811 | family = pdev->dev.platform_data; | 811 | family = pdev->dev.platform_data; |
| 812 | 812 | ||
| 813 | if (family) { | 813 | if (family) { |
| 814 | if (!strcmp(family, "virtex2p")) { | 814 | if (!strcmp(family, "virtex2p")) |
| 815 | regs = &v2_config_registers; | 815 | regs = &v2_config_registers; |
| 816 | } else if (!strcmp(family, "virtex4")) { | 816 | else if (!strcmp(family, "virtex4")) |
| 817 | regs = &v4_config_registers; | 817 | regs = &v4_config_registers; |
| 818 | } else if (!strcmp(family, "virtex5")) { | 818 | else if (!strcmp(family, "virtex5")) |
| 819 | regs = &v5_config_registers; | 819 | regs = &v5_config_registers; |
| 820 | } else if (!strcmp(family, "virtex6")) { | 820 | else if (!strcmp(family, "virtex6")) |
| 821 | regs = &v6_config_registers; | 821 | regs = &v6_config_registers; |
| 822 | } | ||
| 823 | } | 822 | } |
| 824 | 823 | ||
| 825 | return hwicap_setup(&pdev->dev, pdev->id, res, | 824 | return hwicap_setup(&pdev->dev, pdev->id, res, |
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.h b/drivers/char/xilinx_hwicap/xilinx_hwicap.h index 1f687a71e36e..6b963d1c8ba3 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.h +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.h | |||
| @@ -62,11 +62,13 @@ struct hwicap_drvdata { | |||
| 62 | 62 | ||
| 63 | struct hwicap_driver_config { | 63 | struct hwicap_driver_config { |
| 64 | /* Read configuration data given by size into the data buffer. | 64 | /* Read configuration data given by size into the data buffer. |
| 65 | Return 0 if successful. */ | 65 | * Return 0 if successful. |
| 66 | */ | ||
| 66 | int (*get_configuration)(struct hwicap_drvdata *drvdata, u32 *data, | 67 | int (*get_configuration)(struct hwicap_drvdata *drvdata, u32 *data, |
| 67 | u32 size); | 68 | u32 size); |
| 68 | /* Write configuration data given by size from the data buffer. | 69 | /* Write configuration data given by size from the data buffer. |
| 69 | Return 0 if successful. */ | 70 | * Return 0 if successful. |
| 71 | */ | ||
| 70 | int (*set_configuration)(struct hwicap_drvdata *drvdata, u32 *data, | 72 | int (*set_configuration)(struct hwicap_drvdata *drvdata, u32 *data, |
| 71 | u32 size); | 73 | u32 size); |
| 72 | /* Get the status register, bit pattern given by: | 74 | /* Get the status register, bit pattern given by: |
