Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86/intel/vsec: Assign auxdev parent by argument

Instead of checking for a NULL parent argument in intel_vsec_add_aux() and
then assigning it to the probed device, remove this check and just pass the
device in the call. Since this function is exported, return -EINVAL if the
parent is not specified.

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231129222132.2331261-7-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

David E. Box and committed by
Hans de Goede
6dfc2514 1d1b4770

+4 -4
+4 -4
drivers/platform/x86/intel/vsec.c
··· 103 103 struct auxiliary_device *auxdev = &intel_vsec_dev->auxdev; 104 104 int ret, id; 105 105 106 + if (!parent) 107 + return -EINVAL; 108 + 106 109 ret = xa_alloc(&auxdev_array, &intel_vsec_dev->id, intel_vsec_dev, 107 110 PMT_XA_LIMIT, GFP_KERNEL); 108 111 if (ret < 0) { ··· 123 120 kfree(intel_vsec_dev); 124 121 return id; 125 122 } 126 - 127 - if (!parent) 128 - parent = &pdev->dev; 129 123 130 124 auxdev->id = id; 131 125 auxdev->name = name; ··· 205 205 * Pass the ownership of intel_vsec_dev and resource within it to 206 206 * intel_vsec_add_aux() 207 207 */ 208 - return intel_vsec_add_aux(pdev, NULL, no_free_ptr(intel_vsec_dev), 208 + return intel_vsec_add_aux(pdev, &pdev->dev, no_free_ptr(intel_vsec_dev), 209 209 intel_vsec_name(header->id)); 210 210 } 211 211