diff mbox

[1/2] fpga: altera-cvp: remove DRIVER_ATTR() usage

Message ID 20170918101736.GA30415@kroah.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Greg Kroah-Hartman Sept. 18, 2017, 10:17 a.m. UTC
It's better to be explicit and use the DRIVER_ATTR_RW() macro when
defining a driver's sysfs file.

This is part of a series to drop DRIVER_ATTR() from the tree entirely.

Cc: Alan Tull <atull@kernel.org>
Cc: Moritz Fischer <mdf@kernel.org>
Cc: linux-fpga@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/fpga/altera-cvp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Moritz Fischer Sept. 18, 2017, 4:42 p.m. UTC | #1
On Mon, Sep 18, 2017 at 12:17:36PM +0200, Greg Kroah-Hartman wrote:
> It's better to be explicit and use the DRIVER_ATTR_RW() macro when
> defining a driver's sysfs file.
> 
> This is part of a series to drop DRIVER_ATTR() from the tree entirely.
> 
> Cc: Alan Tull <atull@kernel.org>
> Cc: Moritz Fischer <mdf@kernel.org>
> Cc: linux-fpga@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Moritz Fischer <mdf@kernel.org>
> ---
>  drivers/fpga/altera-cvp.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c
> index 08629ee69d11..00e73d28077c 100644
> --- a/drivers/fpga/altera-cvp.c
> +++ b/drivers/fpga/altera-cvp.c
> @@ -361,12 +361,12 @@ static const struct fpga_manager_ops altera_cvp_ops = {
>  	.write_complete	= altera_cvp_write_complete,
>  };
>  
> -static ssize_t show_chkcfg(struct device_driver *dev, char *buf)
> +static ssize_t chkcfg_show(struct device_driver *dev, char *buf)
>  {
>  	return snprintf(buf, 3, "%d\n", altera_cvp_chkcfg);
>  }
>  
> -static ssize_t store_chkcfg(struct device_driver *drv, const char *buf,
> +static ssize_t chkcfg_store(struct device_driver *drv, const char *buf,
>  			    size_t count)
>  {
>  	int ret;
> @@ -378,7 +378,7 @@ static ssize_t store_chkcfg(struct device_driver *drv, const char *buf,
>  	return count;
>  }
>  
> -static DRIVER_ATTR(chkcfg, 0600, show_chkcfg, store_chkcfg);
> +static DRIVER_ATTR_RW(chkcfg);
>  
>  static int altera_cvp_probe(struct pci_dev *pdev,
>  			    const struct pci_device_id *dev_id);
> -- 
> 2.14.1
>
Alan Tull Sept. 18, 2017, 8:40 p.m. UTC | #2
On Mon, Sep 18, 2017 at 11:42 AM, Moritz Fischer <mdf@kernel.org> wrote:
> On Mon, Sep 18, 2017 at 12:17:36PM +0200, Greg Kroah-Hartman wrote:
>> It's better to be explicit and use the DRIVER_ATTR_RW() macro when
>> defining a driver's sysfs file.
>>
>> This is part of a series to drop DRIVER_ATTR() from the tree entirely.
>>
>> Cc: Alan Tull <atull@kernel.org>
>> Cc: Moritz Fischer <mdf@kernel.org>
>> Cc: linux-fpga@vger.kernel.org
>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Acked-by: Moritz Fischer <mdf@kernel.org>
Acked-by: Alan Tull <atull@kernel.org>
>> ---
>>  drivers/fpga/altera-cvp.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c
>> index 08629ee69d11..00e73d28077c 100644
>> --- a/drivers/fpga/altera-cvp.c
>> +++ b/drivers/fpga/altera-cvp.c
>> @@ -361,12 +361,12 @@ static const struct fpga_manager_ops altera_cvp_ops = {
>>       .write_complete = altera_cvp_write_complete,
>>  };
>>
>> -static ssize_t show_chkcfg(struct device_driver *dev, char *buf)
>> +static ssize_t chkcfg_show(struct device_driver *dev, char *buf)
>>  {
>>       return snprintf(buf, 3, "%d\n", altera_cvp_chkcfg);
>>  }
>>
>> -static ssize_t store_chkcfg(struct device_driver *drv, const char *buf,
>> +static ssize_t chkcfg_store(struct device_driver *drv, const char *buf,
>>                           size_t count)
>>  {
>>       int ret;
>> @@ -378,7 +378,7 @@ static ssize_t store_chkcfg(struct device_driver *drv, const char *buf,
>>       return count;
>>  }
>>
>> -static DRIVER_ATTR(chkcfg, 0600, show_chkcfg, store_chkcfg);
>> +static DRIVER_ATTR_RW(chkcfg);
>>
>>  static int altera_cvp_probe(struct pci_dev *pdev,
>>                           const struct pci_device_id *dev_id);
>> --
>> 2.14.1
>>
--
To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg Kroah-Hartman Sept. 19, 2017, 7:17 a.m. UTC | #3
On Mon, Sep 18, 2017 at 03:40:13PM -0500, Alan Tull wrote:
> On Mon, Sep 18, 2017 at 11:42 AM, Moritz Fischer <mdf@kernel.org> wrote:
> > On Mon, Sep 18, 2017 at 12:17:36PM +0200, Greg Kroah-Hartman wrote:
> >> It's better to be explicit and use the DRIVER_ATTR_RW() macro when
> >> defining a driver's sysfs file.
> >>
> >> This is part of a series to drop DRIVER_ATTR() from the tree entirely.
> >>
> >> Cc: Alan Tull <atull@kernel.org>
> >> Cc: Moritz Fischer <mdf@kernel.org>
> >> Cc: linux-fpga@vger.kernel.org
> >> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Acked-by: Moritz Fischer <mdf@kernel.org>
> Acked-by: Alan Tull <atull@kernel.org>

Thanks to both of you for the review.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-fpga" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c
index 08629ee69d11..00e73d28077c 100644
--- a/drivers/fpga/altera-cvp.c
+++ b/drivers/fpga/altera-cvp.c
@@ -361,12 +361,12 @@  static const struct fpga_manager_ops altera_cvp_ops = {
 	.write_complete	= altera_cvp_write_complete,
 };
 
-static ssize_t show_chkcfg(struct device_driver *dev, char *buf)
+static ssize_t chkcfg_show(struct device_driver *dev, char *buf)
 {
 	return snprintf(buf, 3, "%d\n", altera_cvp_chkcfg);
 }
 
-static ssize_t store_chkcfg(struct device_driver *drv, const char *buf,
+static ssize_t chkcfg_store(struct device_driver *drv, const char *buf,
 			    size_t count)
 {
 	int ret;
@@ -378,7 +378,7 @@  static ssize_t store_chkcfg(struct device_driver *drv, const char *buf,
 	return count;
 }
 
-static DRIVER_ATTR(chkcfg, 0600, show_chkcfg, store_chkcfg);
+static DRIVER_ATTR_RW(chkcfg);
 
 static int altera_cvp_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *dev_id);