Commit 8adc8c56 authored by Pavel Pisa's avatar Pavel Pisa
Browse files

driver: correct some problems reported by make checkpatch.


Signed-off-by: Pavel Pisa's avatarPavel Pisa <pisa@cmp.felk.cvut.cz>
parent 7a265ed8
......@@ -50,7 +50,7 @@ MODULE_DESCRIPTION("CTU CAN FD interface");
#define DRV_NAME "ctucanfd"
static const char *ctucan_state_strings[] = {
static const char * const ctucan_state_strings[] = {
"CAN_STATE_ERROR_ACTIVE",
"CAN_STATE_ERROR_WARNING",
"CAN_STATE_ERROR_PASSIVE",
......@@ -164,14 +164,14 @@ static int ctucan_set_secondary_sample_point(struct net_device *ndev)
}
// Use for bit-rates above 1 Mbits/s
if (dbt->bitrate > 1000000){
if (dbt->bitrate > 1000000) {
ssp_ena = true;
// Calculate SSP in minimal time quanta
ssp_offset = (priv->can.clock.freq / 1000) *
dbt->sample_point / dbt->bitrate;
if (ssp_offset > 127){
if (ssp_offset > 127) {
netdev_warn(ndev, "SSP offset saturated to 127\n");
ssp_offset = 127;
}
......@@ -330,7 +330,7 @@ static int ctucan_start_xmit(struct sk_buff *skb, struct net_device *ndev)
if (!ok) {
netdev_err(ndev,
"BUG! TXNF set but cannot insert frame into TXTB! HW Bug?");
"BUG! TXNF set but cannot insert frame into TXTB! HW Bug?");
return NETDEV_TX_BUSY;
}
can_put_echo_skb(skb, ndev, txb_id);
......@@ -1099,16 +1099,16 @@ EXPORT_SYMBOL(ctucan_probe_common);
static __init int ctucan_init(void)
{
printk(KERN_INFO "%s CAN netdevice driver\n", DRV_NAME);
printk(KERN_INFO "%s CAN netdevice driver\n", DRV_NAME);
return 0;
return 0;
}
module_init(ctucan_init);
static __exit void ctucan_exit(void)
{
printk(KERN_INFO "%s: driver removed\n", DRV_NAME);
printk(KERN_INFO "%s: driver removed\n", DRV_NAME);
}
module_exit(ctucan_exit);
......@@ -767,7 +767,7 @@ void ctucan_hw_configure_ssp(struct ctucan_hw_priv *priv, bool enable_ssp,
union ctu_can_fd_trv_delay_ssp_cfg ssp_cfg;
ssp_cfg.u32 = 0;
if (enable_ssp){
if (enable_ssp) {
if (use_trv_delay)
ssp_cfg.s.ssp_src = SSP_SRC_MEAS_N_OFFSET;
else
......
......@@ -223,7 +223,7 @@ static int ctucan_pci_probe(struct pci_dev *pdev,
return 0;
err_free_board:
err_free_board:
pci_set_drvdata(pdev, NULL);
kfree(bdata);
err_pci_iounmap_bar0:
......@@ -272,28 +272,28 @@ static void ctucan_pci_remove(struct pci_dev *pdev)
struct ctucan_priv, peers_on_pdev)) != NULL) {
ndev = priv->can.dev;
unregister_candev(ndev);
unregister_candev(ndev);
netif_napi_del(&priv->napi);
netif_napi_del(&priv->napi);
list_del_init(&priv->peers_on_pdev);
free_candev(ndev);
}
list_del_init(&priv->peers_on_pdev);
free_candev(ndev);
}
pci_iounmap(pdev, bdata->bar1_base);
pci_iounmap(pdev, bdata->bar1_base);
if (bdata->use_msi) {
pci_disable_msi(pdev);
pci_clear_master(pdev);
}
if (bdata->use_msi) {
pci_disable_msi(pdev);
pci_clear_master(pdev);
}
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_iounmap(pdev, bdata->bar0_base);
pci_iounmap(pdev, bdata->bar0_base);
pci_set_drvdata(pdev, NULL);
kfree(bdata);
pci_set_drvdata(pdev, NULL);
kfree(bdata);
}
static SIMPLE_DEV_PM_OPS(ctucan_pci_pm_ops, ctucan_suspend, ctucan_resume);
......
......@@ -97,7 +97,8 @@ static int ctucan_platform_probe(struct platform_device *pdev)
if (ret < 0)
platform_set_drvdata(pdev, NULL);
err:
err:
return ret;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment