Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b80b149e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

ANDROID: GKI: device.h: add Android ABI padding to some structures



Try to mitigate potential future driver core api changes by padding to
struct bus_type, struct device_driver, struct class, and struct device.

Based on a patch from Michal Marek <mmarek@suse.cz> from the SLES kernel

Bug: 151154716
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Change-Id: I6892cde6481ba775789f0c02239dcfde3a26b56e
parent 52f916bd
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <linux/uidgid.h>
#include <linux/gfp.h>
#include <linux/overflow.h>
#include <linux/android_kabi.h>
#include <asm/device.h>

struct device;
@@ -151,6 +152,11 @@ struct bus_type {
	struct lock_class_key lock_key;

	bool need_parent_lock;

	ANDROID_KABI_RESERVE(1);
	ANDROID_KABI_RESERVE(2);
	ANDROID_KABI_RESERVE(3);
	ANDROID_KABI_RESERVE(4);
};

extern int __must_check bus_register(struct bus_type *bus);
@@ -314,6 +320,11 @@ struct device_driver {
	void (*coredump) (struct device *dev);

	struct driver_private *p;

	ANDROID_KABI_RESERVE(1);
	ANDROID_KABI_RESERVE(2);
	ANDROID_KABI_RESERVE(3);
	ANDROID_KABI_RESERVE(4);
};


@@ -440,6 +451,11 @@ struct class {
	const struct dev_pm_ops *pm;

	struct subsys_private *p;

	ANDROID_KABI_RESERVE(1);
	ANDROID_KABI_RESERVE(2);
	ANDROID_KABI_RESERVE(3);
	ANDROID_KABI_RESERVE(4);
};

struct class_dev_iter {
@@ -1083,6 +1099,15 @@ struct device {
	bool			offline:1;
	bool			of_node_reused:1;
	bool			state_synced:1;

	ANDROID_KABI_RESERVE(1);
	ANDROID_KABI_RESERVE(2);
	ANDROID_KABI_RESERVE(3);
	ANDROID_KABI_RESERVE(4);
	ANDROID_KABI_RESERVE(5);
	ANDROID_KABI_RESERVE(6);
	ANDROID_KABI_RESERVE(7);
	ANDROID_KABI_RESERVE(8);
};

static inline struct device *kobj_to_dev(struct kobject *kobj)