device: Add helper function devfn_disable()

devfn_disable() function is used to disable a device based on
given bus, device function number. This function checks if the
device is at enable state and disables the device.

Change-Id: Ia4a8bfec7fc95c729a5bb156f88e9aab3bf5dd41
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55354
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
diff --git a/src/include/device/device.h b/src/include/device/device.h
index afa6a40..8f0650f 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -178,6 +178,8 @@
 void dev_optimize(void);
 void dev_finalize(void);
 void dev_finalize_chips(void);
+/* Function used to override device state */
+void devfn_disable(const struct bus *bus, unsigned int devfn);
 
 /* Generic device helper functions */
 int reset_bus(struct bus *bus);