Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11b3c20b authored by Gabriel Krisman Bertazi's avatar Gabriel Krisman Bertazi Committed by Daniel Vetter
Browse files

drm: Change the return type of the unload hook to void



The integer returned by the unload hook is ignored by the drm core, so
let's make it void.

This patch was created using the following Coccinelle semantic script
(except for the declaration and comment in drm_drv.h):

Compile-tested only.

// <smpl>
@ get_name @
struct drm_driver drv;
identifier fn;
@@
drv.unload = fn;

@ replace_type @
identifier get_name.fn;
@@
- int
+ void
fn (...)
{
...
}

@ remove_return_param @
identifier get_name.fn;
@@
void fn (...)
{
<...
if (...)
return
- ...
;
...>
 }

@ drop_final_return @
identifier get_name.fn;
@@
void fn (...)
{
...

- return 0;
}
// </smpl>

Suggested-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Signed-off-by: default avatarGabriel Krisman Bertazi <krisman@collabora.co.uk>
Acked-by: default avatarChristian König <christian.koenig@amd.com&gt;.>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170106175731.29196-1-krisman@collabora.co.uk
parent 931c670d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1711,7 +1711,7 @@ extern const struct drm_ioctl_desc amdgpu_ioctls_kms[];
extern const int amdgpu_max_kms_ioctl;

int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags);
int amdgpu_driver_unload_kms(struct drm_device *dev);
void amdgpu_driver_unload_kms(struct drm_device *dev);
void amdgpu_driver_lastclose_kms(struct drm_device *dev);
int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv);
void amdgpu_driver_postclose_kms(struct drm_device *dev,
+2 −3
Original line number Diff line number Diff line
@@ -50,12 +50,12 @@ static inline bool amdgpu_has_atpx(void) { return false; }
 * This is the main unload function for KMS (all asics).
 * Returns 0 on success.
 */
int amdgpu_driver_unload_kms(struct drm_device *dev)
void amdgpu_driver_unload_kms(struct drm_device *dev)
{
	struct amdgpu_device *adev = dev->dev_private;

	if (adev == NULL)
		return 0;
		return;

	if (adev->rmmio == NULL)
		goto done_free;
@@ -74,7 +74,6 @@ int amdgpu_driver_unload_kms(struct drm_device *dev)
done_free:
	kfree(adev);
	dev->dev_private = NULL;
	return 0;
}

/**
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ struct ast_private {
};

int ast_driver_load(struct drm_device *dev, unsigned long flags);
int ast_driver_unload(struct drm_device *dev);
void ast_driver_unload(struct drm_device *dev);

struct ast_gem_object;

+1 −2
Original line number Diff line number Diff line
@@ -476,7 +476,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
	return ret;
}

int ast_driver_unload(struct drm_device *dev)
void ast_driver_unload(struct drm_device *dev)
{
	struct ast_private *ast = dev->dev_private;

@@ -489,7 +489,6 @@ int ast_driver_unload(struct drm_device *dev)
	pci_iounmap(dev->pdev, ast->ioregs);
	pci_iounmap(dev->pdev, ast->regs);
	kfree(ast);
	return 0;
}

int ast_gem_create(struct drm_device *dev,
+1 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ MODULE_PARM_DESC(fbdev, "register fbdev device");
/* ---------------------------------------------------------------------- */
/* drm interface                                                          */

static int bochs_unload(struct drm_device *dev)
static void bochs_unload(struct drm_device *dev)
{
	struct bochs_device *bochs = dev->dev_private;

@@ -29,7 +29,6 @@ static int bochs_unload(struct drm_device *dev)
	bochs_hw_fini(dev);
	kfree(bochs);
	dev->dev_private = NULL;
	return 0;
}

static int bochs_load(struct drm_device *dev, unsigned long flags)
Loading