mirror of
git://nv-tegra.nvidia.com/linux-hwpm.git
synced 2025-12-22 17:30:40 +03:00
tegra: hwpm: Use conftest for 'struct class' changes
In Linux v6.2, the 'struct class.devnode()' function was updated to take a 'const struct device *' instead of a 'struct device *'. A test has been added to the conftest script to check for this and so instead of relying on kernel version, use the definition generated by conftest to select the appropriate function to use. This is beneficial for working with 3rd party Linux kernels that may have back-ported upstream changes into their kernel and so the kernel version checks do not work. Bug 4119327 Change-Id: I751b7401adee7b337192e255253b974cbd803642 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2991966 Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
971645b49c
commit
4b2fd8250d
@@ -14,6 +14,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/module.h>
|
||||
@@ -50,10 +52,10 @@ static const struct of_device_id tegra_soc_hwpm_of_match[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, tegra_soc_hwpm_of_match);
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0))
|
||||
static char *tegra_hwpm_get_devnode(struct device *dev, umode_t *mode)
|
||||
#else
|
||||
#if defined(NV_CLASS_STRUCT_DEVNODE_HAS_CONST_DEV_ARG)
|
||||
static char *tegra_hwpm_get_devnode(const struct device *dev, umode_t *mode)
|
||||
#else
|
||||
static char *tegra_hwpm_get_devnode(struct device *dev, umode_t *mode)
|
||||
#endif
|
||||
{
|
||||
if (!mode) {
|
||||
|
||||
Reference in New Issue
Block a user