Skip to content

Commit

Permalink
ACPI: Constify ACPI device IDs in documentation
Browse files Browse the repository at this point in the history
ACPI device ID arrays normally don't need to be written to as they're
only ever read. The common usage -- embedding pointers to acpi_device_id
arrays in other data structures -- reference them as 'const', e.g. as in
struct acpi_driver / acpi_scan_handler / device_driver. The matchers are
taking const pointers, too. So it's only natural, to propose using const
arrays. Change the documentation accordingly.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Mathias Krause authored and Rafael J. Wysocki committed Jun 18, 2015
1 parent eb34866 commit 1a147ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Documentation/acpi/enumeration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Adding ACPI support for an existing driver should be pretty
straightforward. Here is the simplest example:

#ifdef CONFIG_ACPI
static struct acpi_device_id mydrv_acpi_match[] = {
static const struct acpi_device_id mydrv_acpi_match[] = {
/* ACPI IDs here */
{ }
};
Expand Down Expand Up @@ -166,7 +166,7 @@ the platform device drivers. Below is an example where we add ACPI support
to at25 SPI eeprom driver (this is meant for the above ACPI snippet):

#ifdef CONFIG_ACPI
static struct acpi_device_id at25_acpi_match[] = {
static const struct acpi_device_id at25_acpi_match[] = {
{ "AT25", 0 },
{ },
};
Expand Down Expand Up @@ -230,7 +230,7 @@ Below is an example of how to add ACPI support to the existing mpu3050
input driver:

#ifdef CONFIG_ACPI
static struct acpi_device_id mpu3050_acpi_match[] = {
static const struct acpi_device_id mpu3050_acpi_match[] = {
{ "MPU3050", 0 },
{ },
};
Expand Down

0 comments on commit 1a147ed

Please sign in to comment.