Skip to content

Commit

Permalink
xrp-kernel: add xrp_deinit_hw
Browse files Browse the repository at this point in the history
There's no easy way to get HW-specific data pointer in the driver remove
handler of the HW-specific driver. Provide function xrp_deinit_hw that
returns HW-specific data pointer to its second optional argument.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
  • Loading branch information
jcmvbkbc committed Aug 22, 2018
1 parent 491a582 commit 35cb635
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions xrp-kernel/xrp_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ long xrp_init_cma(struct platform_device *pdev, enum xrp_init_flags flags,
const struct xrp_hw_ops *hw, void *hw_arg);

int xrp_deinit(struct platform_device *pdev);
int xrp_deinit_hw(struct platform_device *pdev, void **hw_arg);
irqreturn_t xrp_irq_handler(int irq, struct xvp *xvp);
int xrp_runtime_resume(struct device *dev);
int xrp_runtime_suspend(struct device *dev);
Expand Down
10 changes: 10 additions & 0 deletions xrp-kernel/xvp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1965,6 +1965,16 @@ int xrp_deinit(struct platform_device *pdev)
}
EXPORT_SYMBOL(xrp_deinit);

int xrp_deinit_hw(struct platform_device *pdev, void **hw_arg)
{
if (hw_arg) {
struct xvp *xvp = platform_get_drvdata(pdev);
*hw_arg = xvp->hw_arg;
}
return xrp_deinit(pdev);
}
EXPORT_SYMBOL(xrp_deinit_hw);

static void *get_hw_sync_data(void *hw_arg, size_t *sz)
{
void *p = kzalloc(64, GFP_KERNEL);
Expand Down

0 comments on commit 35cb635

Please sign in to comment.