Commit b8ac9fc0e8cda9f9776019c5b0464b0c6d2d4c90

Authored by Stephen Rothwell
Committed by Greg Kroah-Hartman
1 parent a2ab3d3000

uio: make uio_info's name and version const

These are only ever assigned constant strings and never modified.

This was noticed because Wolfram Sang needed to cast the result of
of_get_property() in order to assign it to the name field of a struct
uio_info.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 2 changed files with 4 additions and 4 deletions Side-by-side Diff

Documentation/DocBook/uio-howto.tmpl
... ... @@ -393,12 +393,12 @@
393 393  
394 394 <itemizedlist>
395 395 <listitem><para>
396   -<varname>char *name</varname>: Required. The name of your driver as
  396 +<varname>const char *name</varname>: Required. The name of your driver as
397 397 it will appear in sysfs. I recommend using the name of your module for this.
398 398 </para></listitem>
399 399  
400 400 <listitem><para>
401   -<varname>char *version</varname>: Required. This string appears in
  401 +<varname>const char *version</varname>: Required. This string appears in
402 402 <filename>/sys/class/uio/uioX/version</filename>.
403 403 </para></listitem>
404 404  
include/linux/uio_driver.h
... ... @@ -76,8 +76,8 @@
76 76 */
77 77 struct uio_info {
78 78 struct uio_device *uio_dev;
79   - char *name;
80   - char *version;
  79 + const char *name;
  80 + const char *version;
81 81 struct uio_mem mem[MAX_UIO_MAPS];
82 82 struct uio_port port[MAX_UIO_PORT_REGIONS];
83 83 long irq;