Commit ecd0cb00 authored by Mark A. Allyn's avatar Mark A. Allyn Committed by Greg Kroah-Hartman
Browse files

staging: sep: update initialisation



In particular we want to always do the reconfigure

[This is picked out of the differences between the upstream driver and
 the staging driver. I'm resolving the differences as a series of updates -AC]

Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6ab80c26
Loading
Loading
Loading
Loading
+13 −13
Original line number Original line Diff line number Diff line
@@ -4150,7 +4150,6 @@ static int __devinit sep_probe(struct pci_dev *pdev,


	dev_dbg(&sep->pdev->dev, "sep probe: PCI obtained, "
	dev_dbg(&sep->pdev->dev, "sep probe: PCI obtained, "
		"device being prepared\n");
		"device being prepared\n");
	dev_dbg(&sep->pdev->dev, "revision is %d\n", sep->pdev->revision);


	/* Set up our register area */
	/* Set up our register area */
	sep->reg_physical_addr = pci_resource_start(sep->pdev, 0);
	sep->reg_physical_addr = pci_resource_start(sep->pdev, 0);
@@ -4213,38 +4212,39 @@ static int __devinit sep_probe(struct pci_dev *pdev,
		goto end_function_deallocate_sep_shared_area;
		goto end_function_deallocate_sep_shared_area;


	/* The new chip requires a shared area reconfigure */
	/* The new chip requires a shared area reconfigure */
	if (sep->pdev->revision != 0) { /* Only for new chip */
	error = sep_reconfig_shared_area(sep);
	error = sep_reconfig_shared_area(sep);
	if (error)
	if (error)
		goto end_function_free_irq;
		goto end_function_free_irq;
	}


	sep->in_use = 1;
	sep->in_use = 1;


	/* Finally magic up the device nodes */
	/* Finally magic up the device nodes */
	/* Register driver with the fs */
	/* Register driver with the fs */
	error = sep_register_driver_with_fs(sep);
	error = sep_register_driver_with_fs(sep);
	if (error)

	if (error) {
		dev_err(&sep->pdev->dev, "error registering dev file\n");
		goto end_function_free_irq;
		goto end_function_free_irq;
	}


	sep->in_use = 0; /* through touching the device */
#ifdef SEP_ENABLE_RUNTIME_PM
#ifdef SEP_ENABLE_RUNTIME_PM
	pm_runtime_put_noidle(&sep->pdev->dev);
	pm_runtime_put_noidle(&sep->pdev->dev);
	pm_runtime_allow(&sep->pdev->dev);
	pm_runtime_allow(&sep->pdev->dev);
	pm_runtime_set_autosuspend_delay(&sep->pdev->dev,
	pm_runtime_set_autosuspend_delay(&sep->pdev->dev,
		SUSPEND_DELAY);
		SUSPEND_DELAY);
	pm_runtime_use_autosuspend(&sep->pdev->dev);
	pm_runtime_use_autosuspend(&sep->pdev->dev);
	pm_runtime_mark_last_busy(&sep->pdev->dev);
	sep->power_save_setup = 1;
	sep->power_save_setup = 1;
#endif
#endif

	sep->in_use = 0;

	/* register kernel crypto driver */
	/* register kernel crypto driver */
#if defined(CONFIG_CRYPTO)
	error = sep_crypto_setup();
	error = sep_crypto_setup();
	if (error) {
	if (error) {
		dev_dbg(&sep->pdev->dev, "crypto setup fail\n");
		dev_err(&sep->pdev->dev, "crypto setup failed\n");
		goto end_function_free_irq;
		goto end_function_free_irq;
	}
	}

#endif
	goto end_function;
	goto end_function;


end_function_free_irq:
end_function_free_irq:
@@ -4292,7 +4292,7 @@ static void sep_remove(struct pci_dev *pdev)


	/* Free the shared area  */
	/* Free the shared area  */
	sep_unmap_and_free_shared_area(sep_dev);
	sep_unmap_and_free_shared_area(sep_dev);
	iounmap((void __iomem *)sep_dev->reg_addr);
	iounmap(sep_dev->reg_addr);


#ifdef SEP_ENABLE_RUNTIME_PM
#ifdef SEP_ENABLE_RUNTIME_PM
	if (sep->in_use) {
	if (sep->in_use) {