diff options
| author | David E. Box <[email protected]> | 2023-11-29 22:21:18 +0000 |
|---|---|---|
| committer | Hans de Goede <[email protected]> | 2023-12-04 13:53:29 +0000 |
| commit | 6dfc2514acee37e30ce59f1f25b1f8f6aa7c1b08 (patch) | |
| tree | 482bb49495dbcd3f6770097f96035d5ae80bd5a3 /drivers/platform/x86/intel/vsec.c | |
| parent | platform/x86/intel/vsec: Use cleanup.h (diff) | |
| download | kernel-6dfc2514acee37e30ce59f1f25b1f8f6aa7c1b08.tar.gz kernel-6dfc2514acee37e30ce59f1f25b1f8f6aa7c1b08.zip | |
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 <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Hans de Goede <[email protected]>
Diffstat (limited to 'drivers/platform/x86/intel/vsec.c')
| -rw-r--r-- | drivers/platform/x86/intel/vsec.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c index 6b0e7363397a..bcfb5d480ebd 100644 --- a/drivers/platform/x86/intel/vsec.c +++ b/drivers/platform/x86/intel/vsec.c @@ -103,6 +103,9 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent, struct auxiliary_device *auxdev = &intel_vsec_dev->auxdev; int ret, id; + if (!parent) + return -EINVAL; + ret = xa_alloc(&auxdev_array, &intel_vsec_dev->id, intel_vsec_dev, PMT_XA_LIMIT, GFP_KERNEL); if (ret < 0) { @@ -121,9 +124,6 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent, return id; } - if (!parent) - parent = &pdev->dev; - auxdev->id = id; auxdev->name = name; auxdev->dev.parent = parent; @@ -205,7 +205,7 @@ static int intel_vsec_add_dev(struct pci_dev *pdev, struct intel_vsec_header *he * Pass the ownership of intel_vsec_dev and resource within it to * intel_vsec_add_aux() */ - return intel_vsec_add_aux(pdev, NULL, no_free_ptr(intel_vsec_dev), + return intel_vsec_add_aux(pdev, &pdev->dev, no_free_ptr(intel_vsec_dev), intel_vsec_name(header->id)); } |
