platform/x86: x86-android-tablets: Add support for instantiating platform-devs
authorHans de Goede <hdegoede@redhat.com>
Wed, 29 Dec 2021 23:14:25 +0000 (00:14 +0100)
committerHans de Goede <hdegoede@redhat.com>
Wed, 5 Jan 2022 10:31:18 +0000 (11:31 +0100)
commit5eba0141206ea521bbcfcf5067c174e825e943dd
tree1b8463291b166a98504fc654d280a1f41c12f5d8
parentcd26465fbc03beaa68979c06fc983be86eafcb4b
platform/x86: x86-android-tablets: Add support for instantiating platform-devs

Add support for instantiating platform-devs, note this also makes some
small changes to the i2c_client instantiating code to make the 2 flows
identical.

Specifically for the pdevs flow pdev_count must only be set after
allocating the pdevs array, to avoid a NULL ptr deref in
x86_android_tablet_cleanup() and the i2c_clients flow is updated
to work the same way.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211229231431.437982-7-hdegoede@redhat.com
drivers/platform/x86/x86-android-tablets.c