| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * iio/dac/max5821.c |
|---|
| 3 | 4 | * Copyright (C) 2014 Philippe Reynes |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 7 | | - * published by the Free Software Foundation. |
|---|
| 8 | 5 | */ |
|---|
| 9 | 6 | |
|---|
| 10 | 7 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 270 | 267 | } |
|---|
| 271 | 268 | } |
|---|
| 272 | 269 | |
|---|
| 273 | | -#ifdef CONFIG_PM_SLEEP |
|---|
| 274 | | -static int max5821_suspend(struct device *dev) |
|---|
| 270 | +static int __maybe_unused max5821_suspend(struct device *dev) |
|---|
| 275 | 271 | { |
|---|
| 276 | 272 | u8 outbuf[2] = { MAX5821_EXTENDED_COMMAND_MODE, |
|---|
| 277 | 273 | MAX5821_EXTENDED_DAC_A | |
|---|
| .. | .. |
|---|
| 281 | 277 | return i2c_master_send(to_i2c_client(dev), outbuf, 2); |
|---|
| 282 | 278 | } |
|---|
| 283 | 279 | |
|---|
| 284 | | -static int max5821_resume(struct device *dev) |
|---|
| 280 | +static int __maybe_unused max5821_resume(struct device *dev) |
|---|
| 285 | 281 | { |
|---|
| 286 | 282 | u8 outbuf[2] = { MAX5821_EXTENDED_COMMAND_MODE, |
|---|
| 287 | 283 | MAX5821_EXTENDED_DAC_A | |
|---|
| .. | .. |
|---|
| 292 | 288 | } |
|---|
| 293 | 289 | |
|---|
| 294 | 290 | static SIMPLE_DEV_PM_OPS(max5821_pm_ops, max5821_suspend, max5821_resume); |
|---|
| 295 | | -#define MAX5821_PM_OPS (&max5821_pm_ops) |
|---|
| 296 | | -#else |
|---|
| 297 | | -#define MAX5821_PM_OPS NULL |
|---|
| 298 | | -#endif /* CONFIG_PM_SLEEP */ |
|---|
| 299 | 291 | |
|---|
| 300 | 292 | static const struct iio_info max5821_info = { |
|---|
| 301 | 293 | .read_raw = max5821_read_raw, |
|---|
| .. | .. |
|---|
| 349 | 341 | data->vref_mv = ret / 1000; |
|---|
| 350 | 342 | |
|---|
| 351 | 343 | indio_dev->name = id->name; |
|---|
| 352 | | - indio_dev->dev.parent = &client->dev; |
|---|
| 353 | 344 | indio_dev->num_channels = ARRAY_SIZE(max5821_channels); |
|---|
| 354 | 345 | indio_dev->channels = max5821_channels; |
|---|
| 355 | 346 | indio_dev->modes = INDIO_DIRECT_MODE; |
|---|
| .. | .. |
|---|
| 392 | 383 | .driver = { |
|---|
| 393 | 384 | .name = "max5821", |
|---|
| 394 | 385 | .of_match_table = max5821_of_match, |
|---|
| 395 | | - .pm = MAX5821_PM_OPS, |
|---|
| 386 | + .pm = &max5821_pm_ops, |
|---|
| 396 | 387 | }, |
|---|
| 397 | 388 | .probe = max5821_probe, |
|---|
| 398 | 389 | .remove = max5821_remove, |
|---|