Commit def07668 authored by Pavel Pisa's avatar Pavel Pisa
Browse files

Merge branch '343-pci-driver-exception-when-signature-not-found' into 'master'

Resolve "PCI driver exception when signature not found."

Closes #343

See merge request !304
parents e015bf36 8adc8c56
......@@ -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;
}
......@@ -1056,6 +1056,7 @@ int ctucan_probe_common(struct device *dev, void __iomem *addr,
if ((priv->p.read_reg(&priv->p, CTU_CAN_FD_DEVICE_ID) &
0xFFFF) != CTU_CAN_FD_ID) {
netdev_err(ndev, "CTU_CAN_FD signature not found\n");
ret = -ENODEV;
goto err_disableclks;
}
}
......
......@@ -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:
......
......@@ -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