| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * coreboot_table.h |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * Copyright 2014 Gerd Hoffmann <kraxel@redhat.com> |
|---|
| 7 | 8 | * Copyright 2017 Google Inc. |
|---|
| 8 | 9 | * Copyright 2017 Samuel Holland <samuel@sholland.org> |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 11 | | - * it under the terms of the GNU General Public License v2.0 as published by |
|---|
| 12 | | - * the Free Software Foundation. |
|---|
| 13 | | - * |
|---|
| 14 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 15 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | | - * GNU General Public License for more details. |
|---|
| 18 | 10 | */ |
|---|
| 19 | 11 | |
|---|
| 20 | 12 | #ifndef __COREBOOT_TABLE_H |
|---|
| 21 | 13 | #define __COREBOOT_TABLE_H |
|---|
| 22 | 14 | |
|---|
| 23 | | -#include <linux/io.h> |
|---|
| 15 | +#include <linux/device.h> |
|---|
| 24 | 16 | |
|---|
| 25 | 17 | /* Coreboot table header structure */ |
|---|
| 26 | 18 | struct coreboot_table_header { |
|---|
| .. | .. |
|---|
| 91 | 83 | /* Unregister a driver that uses the data from a coreboot table. */ |
|---|
| 92 | 84 | void coreboot_driver_unregister(struct coreboot_driver *driver); |
|---|
| 93 | 85 | |
|---|
| 94 | | -/* Initialize coreboot table module given a pointer to iomem */ |
|---|
| 95 | | -int coreboot_table_init(struct device *dev, void __iomem *ptr); |
|---|
| 96 | | - |
|---|
| 97 | | -/* Cleanup coreboot table module */ |
|---|
| 98 | | -int coreboot_table_exit(void); |
|---|
| 86 | +/* module_coreboot_driver() - Helper macro for drivers that don't do |
|---|
| 87 | + * anything special in module init/exit. This eliminates a lot of |
|---|
| 88 | + * boilerplate. Each module may only use this macro once, and |
|---|
| 89 | + * calling it replaces module_init() and module_exit() |
|---|
| 90 | + */ |
|---|
| 91 | +#define module_coreboot_driver(__coreboot_driver) \ |
|---|
| 92 | + module_driver(__coreboot_driver, coreboot_driver_register, \ |
|---|
| 93 | + coreboot_driver_unregister) |
|---|
| 99 | 94 | |
|---|
| 100 | 95 | #endif /* __COREBOOT_TABLE_H */ |
|---|