Skip to content

Commit

Permalink
Merge tag 'linux-can-fixes-for-4.10-20170118' of git://git.kernel.org…
Browse files Browse the repository at this point in the history
…/pub/scm/linux/kernel/git/mkl/linux-can

Marc Kleine-Budde says:

====================
pull-request: can 2017-01-18

this is a pull request for net/master consisting of two patches.

In the first patch Einar Jón fixes a NULL-pointer-deref in the c_can_pci
driver. In the second patch Yegor Yefremov fixes the clock handling in the
ti_hecc driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jan 18, 2017
2 parents 93b43fd + befa601 commit 003ecad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions drivers/net/can/c_can/c_can_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ static int c_can_pci_probe(struct pci_dev *pdev,

dev->irq = pdev->irq;
priv->base = addr;
priv->device = &pdev->dev;

if (!c_can_pci_data->freq) {
dev_err(&pdev->dev, "no clock frequency defined\n");
Expand Down
16 changes: 12 additions & 4 deletions drivers/net/can/ti_hecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,12 @@ static int ti_hecc_probe(struct platform_device *pdev)
netif_napi_add(ndev, &priv->napi, ti_hecc_rx_poll,
HECC_DEF_NAPI_WEIGHT);

clk_enable(priv->clk);
err = clk_prepare_enable(priv->clk);
if (err) {
dev_err(&pdev->dev, "clk_prepare_enable() failed\n");
goto probe_exit_clk;
}

err = register_candev(ndev);
if (err) {
dev_err(&pdev->dev, "register_candev() failed\n");
Expand Down Expand Up @@ -981,7 +986,7 @@ static int ti_hecc_remove(struct platform_device *pdev)
struct ti_hecc_priv *priv = netdev_priv(ndev);

unregister_candev(ndev);
clk_disable(priv->clk);
clk_disable_unprepare(priv->clk);
clk_put(priv->clk);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
iounmap(priv->base);
Expand All @@ -1006,7 +1011,7 @@ static int ti_hecc_suspend(struct platform_device *pdev, pm_message_t state)
hecc_set_bit(priv, HECC_CANMC, HECC_CANMC_PDR);
priv->can.state = CAN_STATE_SLEEPING;

clk_disable(priv->clk);
clk_disable_unprepare(priv->clk);

return 0;
}
Expand All @@ -1015,8 +1020,11 @@ static int ti_hecc_resume(struct platform_device *pdev)
{
struct net_device *dev = platform_get_drvdata(pdev);
struct ti_hecc_priv *priv = netdev_priv(dev);
int err;

clk_enable(priv->clk);
err = clk_prepare_enable(priv->clk);
if (err)
return err;

hecc_clear_bit(priv, HECC_CANMC, HECC_CANMC_PDR);
priv->can.state = CAN_STATE_ERROR_ACTIVE;
Expand Down

0 comments on commit 003ecad

Please sign in to comment.