Skip to content

Commit 6bf87c4

Browse files
andy-shevrafaeljw
authored andcommitted
ACPI: docs: enumeration: Drop ugly ifdeffery from the examples
The ifdeffery around ACPI ID tables are ugly and in some cases even less valuable than plain definitions. Drop them for good to avoid spreading rather bad pattern. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent e92e197 commit 6bf87c4

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

Documentation/firmware-guide/acpi/enumeration.rst

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,16 @@ some minor changes.
4747
Adding ACPI support for an existing driver should be pretty
4848
straightforward. Here is the simplest example::
4949

50-
#ifdef CONFIG_ACPI
5150
static const struct acpi_device_id mydrv_acpi_match[] = {
5251
/* ACPI IDs here */
5352
{ }
5453
};
5554
MODULE_DEVICE_TABLE(acpi, mydrv_acpi_match);
56-
#endif
5755

5856
static struct platform_driver my_driver = {
5957
...
6058
.driver = {
61-
.acpi_match_table = ACPI_PTR(mydrv_acpi_match),
59+
.acpi_match_table = mydrv_acpi_match,
6260
},
6361
};
6462

@@ -173,18 +171,16 @@ The SPI device drivers only need to add ACPI IDs in a similar way than with
173171
the platform device drivers. Below is an example where we add ACPI support
174172
to at25 SPI eeprom driver (this is meant for the above ACPI snippet)::
175173

176-
#ifdef CONFIG_ACPI
177174
static const struct acpi_device_id at25_acpi_match[] = {
178175
{ "AT25", 0 },
179176
{ },
180177
};
181178
MODULE_DEVICE_TABLE(acpi, at25_acpi_match);
182-
#endif
183179

184180
static struct spi_driver at25_driver = {
185181
.driver = {
186182
...
187-
.acpi_match_table = ACPI_PTR(at25_acpi_match),
183+
.acpi_match_table = at25_acpi_match,
188184
},
189185
};
190186

@@ -232,20 +228,18 @@ registered.
232228
Below is an example of how to add ACPI support to the existing mpu3050
233229
input driver::
234230

235-
#ifdef CONFIG_ACPI
236231
static const struct acpi_device_id mpu3050_acpi_match[] = {
237232
{ "MPU3050", 0 },
238233
{ },
239234
};
240235
MODULE_DEVICE_TABLE(acpi, mpu3050_acpi_match);
241-
#endif
242236

243237
static struct i2c_driver mpu3050_i2c_driver = {
244238
.driver = {
245239
.name = "mpu3050",
246240
.pm = &mpu3050_pm,
247241
.of_match_table = mpu3050_of_match,
248-
.acpi_match_table = ACPI_PTR(mpu3050_acpi_match),
242+
.acpi_match_table = mpu3050_acpi_match,
249243
},
250244
.probe = mpu3050_probe,
251245
.remove = mpu3050_remove,

0 commit comments

Comments
 (0)