treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / mmc / core / pwrseq.h
blobf3bb103db9ad456233cecf7c365116740badf875
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) 2014 Linaro Ltd
5 * Author: Ulf Hansson <ulf.hansson@linaro.org>
6 */
7 #ifndef _MMC_CORE_PWRSEQ_H
8 #define _MMC_CORE_PWRSEQ_H
10 #include <linux/types.h>
12 struct mmc_host;
13 struct device;
14 struct module;
16 struct mmc_pwrseq_ops {
17 void (*pre_power_on)(struct mmc_host *host);
18 void (*post_power_on)(struct mmc_host *host);
19 void (*power_off)(struct mmc_host *host);
20 void (*reset)(struct mmc_host *host);
23 struct mmc_pwrseq {
24 const struct mmc_pwrseq_ops *ops;
25 struct device *dev;
26 struct list_head pwrseq_node;
27 struct module *owner;
30 #ifdef CONFIG_OF
32 int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq);
33 void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq);
35 int mmc_pwrseq_alloc(struct mmc_host *host);
36 void mmc_pwrseq_pre_power_on(struct mmc_host *host);
37 void mmc_pwrseq_post_power_on(struct mmc_host *host);
38 void mmc_pwrseq_power_off(struct mmc_host *host);
39 void mmc_pwrseq_reset(struct mmc_host *host);
40 void mmc_pwrseq_free(struct mmc_host *host);
42 #else
44 static inline int mmc_pwrseq_register(struct mmc_pwrseq *pwrseq)
46 return -ENOSYS;
48 static inline void mmc_pwrseq_unregister(struct mmc_pwrseq *pwrseq) {}
49 static inline int mmc_pwrseq_alloc(struct mmc_host *host) { return 0; }
50 static inline void mmc_pwrseq_pre_power_on(struct mmc_host *host) {}
51 static inline void mmc_pwrseq_post_power_on(struct mmc_host *host) {}
52 static inline void mmc_pwrseq_power_off(struct mmc_host *host) {}
53 static inline void mmc_pwrseq_reset(struct mmc_host *host) {}
54 static inline void mmc_pwrseq_free(struct mmc_host *host) {}
56 #endif
58 #endif