From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org,
kernel@pengutronix.de,
Gerhard Uttenthaler <uttenthaler@ems-wuensche.com>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH net-next 15/47] can: ems_pci: Fix code style, copyright and email address
Date: Mon, 6 Feb 2023 14:15:48 +0100 [thread overview]
Message-ID: <20230206131620.2758724-16-mkl@pengutronix.de> (raw)
In-Reply-To: <20230206131620.2758724-1-mkl@pengutronix.de>
From: Gerhard Uttenthaler <uttenthaler@ems-wuensche.com>
Fix code style complained by checkpatch.pl, add Copyright and
fix email address
Signed-off-by: Gerhard Uttenthaler <uttenthaler@ems-wuensche.com>
Link: https://lore.kernel.org/all/20230120112616.6071-2-uttenthaler@ems-wuensche.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/sja1000/ems_pci.c | 45 ++++++++++++++-----------------
1 file changed, 20 insertions(+), 25 deletions(-)
diff --git a/drivers/net/can/sja1000/ems_pci.c b/drivers/net/can/sja1000/ems_pci.c
index 4ab91759a5c6..c34788b9a6d5 100644
--- a/drivers/net/can/sja1000/ems_pci.c
+++ b/drivers/net/can/sja1000/ems_pci.c
@@ -3,6 +3,7 @@
* Copyright (C) 2007 Wolfgang Grandegger <wg@grandegger.com>
* Copyright (C) 2008 Markus Plessing <plessing@ems-wuensche.com>
* Copyright (C) 2008 Sebastian Haas <haas@ems-wuensche.com>
+ * Copyright (C) 2023 EMS Dr. Thomas Wuensche
*/
#include <linux/kernel.h>
@@ -19,7 +20,7 @@
#define DRV_NAME "ems_pci"
-MODULE_AUTHOR("Sebastian Haas <haas@ems-wuenche.com>");
+MODULE_AUTHOR("Sebastian Haas <support@ems-wuensche.com>");
MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-PCI/PCIe/104P CAN cards");
MODULE_LICENSE("GPL v2");
@@ -40,8 +41,7 @@ struct ems_pci_card {
#define EMS_PCI_CAN_CLOCK (16000000 / 2)
-/*
- * Register definitions and descriptions are from LinCAN 0.3.3.
+/* Register definitions and descriptions are from LinCAN 0.3.3.
*
* PSB4610 PITA-2 bridge control registers
*/
@@ -52,8 +52,7 @@ struct ems_pci_card {
#define PITA2_MISC 0x1c /* Miscellaneous Register */
#define PITA2_MISC_CONFIG 0x04000000 /* Multiplexed parallel interface */
-/*
- * Register definitions for the PLX 9030
+/* Register definitions for the PLX 9030
*/
#define PLX_ICSR 0x4c /* Interrupt Control/Status register */
#define PLX_ICSR_LINTI1_ENA 0x0001 /* LINTi1 Enable */
@@ -62,8 +61,7 @@ struct ems_pci_card {
#define PLX_ICSR_ENA_CLR (PLX_ICSR_LINTI1_ENA | PLX_ICSR_PCIINT_ENA | \
PLX_ICSR_LINTI1_CLR)
-/*
- * The board configuration is probably following:
+/* The board configuration is probably following:
* RX1 is connected to ground.
* TX1 is not connected.
* CLKO is not connected.
@@ -72,8 +70,7 @@ struct ems_pci_card {
*/
#define EMS_PCI_OCR (OCR_TX0_PUSHPULL | OCR_TX1_PUSHPULL)
-/*
- * In the CDR register, you should set CBP to 1.
+/* In the CDR register, you should set CBP to 1.
* You will probably also want to set the clock divider value to 7
* (meaning direct oscillator output) because the second SJA1000 chip
* is driven by the first one CLKOUT output.
@@ -100,8 +97,7 @@ static const struct pci_device_id ems_pci_tbl[] = {
};
MODULE_DEVICE_TABLE(pci, ems_pci_tbl);
-/*
- * Helper to read internal registers from card logic (not CAN)
+/* Helper to read internal registers from card logic (not CAN)
*/
static u8 ems_pci_v1_readb(struct ems_pci_card *card, unsigned int port)
{
@@ -146,8 +142,7 @@ static void ems_pci_v2_post_irq(const struct sja1000_priv *priv)
writel(PLX_ICSR_ENA_CLR, card->conf_addr + PLX_ICSR);
}
-/*
- * Check if a CAN controller is present at the specified location
+/* Check if a CAN controller is present at the specified location
* by trying to set 'em into the PeliCAN mode
*/
static inline int ems_pci_check_chan(const struct sja1000_priv *priv)
@@ -185,10 +180,10 @@ static void ems_pci_del_card(struct pci_dev *pdev)
free_sja1000dev(dev);
}
- if (card->base_addr != NULL)
+ if (card->base_addr)
pci_iounmap(card->pci_dev, card->base_addr);
- if (card->conf_addr != NULL)
+ if (card->conf_addr)
pci_iounmap(card->pci_dev, card->conf_addr);
kfree(card);
@@ -202,8 +197,7 @@ static void ems_pci_card_reset(struct ems_pci_card *card)
writeb(0, card->base_addr);
}
-/*
- * Probe PCI device for EMS CAN signature and register each available
+/* Probe PCI device for EMS CAN signature and register each available
* CAN channel to SJA1000 Socket-CAN subsystem.
*/
static int ems_pci_add_card(struct pci_dev *pdev,
@@ -222,8 +216,8 @@ static int ems_pci_add_card(struct pci_dev *pdev,
}
/* Allocating card structures to hold addresses, ... */
- card = kzalloc(sizeof(struct ems_pci_card), GFP_KERNEL);
- if (card == NULL) {
+ card = kzalloc(sizeof(*card), GFP_KERNEL);
+ if (!card) {
pci_disable_device(pdev);
return -ENOMEM;
}
@@ -248,13 +242,13 @@ static int ems_pci_add_card(struct pci_dev *pdev,
/* Remap configuration space and controller memory area */
card->conf_addr = pci_iomap(pdev, 0, conf_size);
- if (card->conf_addr == NULL) {
+ if (!card->conf_addr) {
err = -ENOMEM;
goto failure_cleanup;
}
card->base_addr = pci_iomap(pdev, base_bar, EMS_PCI_BASE_SIZE);
- if (card->base_addr == NULL) {
+ if (!card->base_addr) {
err = -ENOMEM;
goto failure_cleanup;
}
@@ -281,7 +275,7 @@ static int ems_pci_add_card(struct pci_dev *pdev,
/* Detect available channels */
for (i = 0; i < max_chan; i++) {
dev = alloc_sja1000dev(0);
- if (dev == NULL) {
+ if (!dev) {
err = -ENOMEM;
goto failure_cleanup;
}
@@ -325,8 +319,9 @@ static int ems_pci_add_card(struct pci_dev *pdev,
/* Register SJA1000 device */
err = register_sja1000dev(dev);
if (err) {
- dev_err(&pdev->dev, "Registering device failed "
- "(err=%d)\n", err);
+ dev_err(&pdev->dev,
+ "Registering device failed: %pe\n",
+ ERR_PTR(err));
free_sja1000dev(dev);
goto failure_cleanup;
}
@@ -334,7 +329,7 @@ static int ems_pci_add_card(struct pci_dev *pdev,
card->channels++;
dev_info(&pdev->dev, "Channel #%d at 0x%p, irq %d\n",
- i + 1, priv->reg_base, dev->irq);
+ i + 1, priv->reg_base, dev->irq);
} else {
free_sja1000dev(dev);
}
--
2.39.1
next prev parent reply other threads:[~2023-02-06 13:17 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 13:15 [PATCH net-next 0/47] pull-request: can-next 2023-02-06 Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 01/47] can: gw: give feedback on missing CGW_FLAGS_CAN_IIF_TX_OK flag Marc Kleine-Budde
2023-02-07 15:30 ` patchwork-bot+netdevbpf
2023-02-06 13:15 ` [PATCH net-next 02/47] can: isotp: check CAN address family in isotp_bind() Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 03/47] can: mcp251xfd: regmap: optimizing transfer size for CRC transfers size 1 Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 04/47] dt-bindings: can: renesas,rcar-canfd: R-Car V3U is R-Car Gen4 Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 05/47] dt-bindings: can: renesas,rcar-canfd: Document R-Car V4H support Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 06/47] dt-bindings: can: renesas,rcar-canfd: Add transceiver support Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 07/47] can: rcar_canfd: Fix R-Car V3U CAN mode selection Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 08/47] can: rcar_canfd: Fix R-Car V3U GAFLCFG field accesses Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 09/47] can: rcar_canfd: Abstract out DCFG address differences Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 10/47] can: rcar_canfd: Add support for R-Car Gen4 Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 11/47] can: rcar_canfd: Fix R-Car Gen4 DCFG.DSJW field width Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 12/47] can: rcar_canfd: Fix R-Car Gen4 CFCC.CFTML " Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 13/47] can: rcar_canfd: Sort included header files Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 14/47] can: rcar_canfd: Add helper variable dev Marc Kleine-Budde
2023-02-06 13:15 ` Marc Kleine-Budde [this message]
2023-02-06 13:15 ` [PATCH net-next 16/47] can: ems_pci: Add Asix AX99100 definitions Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 17/47] can: ems_pci: Initialize BAR registers Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 18/47] can: ems_pci: Add read/write register and post irq functions Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 19/47] can: ems_pci: Initialize CAN controller base addresses Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 20/47] can: ems_pci: Add IRQ enable Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 21/47] can: ems_pci: Deassert hardware reset Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 22/47] can: ems_pci: Add myself as module author Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 23/47] can: peak_usb: rename device_id to CAN channel ID Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 24/47] can: peak_usb: add callback to read CAN channel ID of PEAK CAN-FD devices Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 25/47] can: peak_usb: allow flashing of the CAN channel ID Marc Kleine-Budde
2023-02-06 13:15 ` [PATCH net-next 26/47] can: peak_usb: replace unregister_netdev() with unregister_candev() Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 27/47] can: peak_usb: add ethtool interface to user-configurable CAN channel identifier Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 28/47] can: peak_usb: export PCAN CAN channel ID as sysfs device attribute Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 29/47] can: peak_usb: align CAN channel ID format in log with sysfs attribute Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 30/47] can: peak_usb: Reorder include directives alphabetically Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 31/47] can: bittiming(): replace open coded variants of can_bit_time() Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 32/47] can: bittiming: can_fixup_bittiming(): use CAN_SYNC_SEG instead of 1 Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 33/47] can: bittiming: can_fixup_bittiming(): set effective tq Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 34/47] can: bittiming: can_get_bittiming(): use direct return and remove unneeded else Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 35/47] can: dev: register_candev(): ensure that bittiming const are valid Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 36/47] can: dev: register_candev(): bail out if both fixed bit rates and bit timing constants are provided Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 37/47] can: netlink: can_validate(): validate sample point for CAN and CAN-FD Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 38/47] can: netlink: can_changelink(): convert from netdev_err() to NL_SET_ERR_MSG_FMT() Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 39/47] can: bittiming: can_changelink() pass extack down callstack Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 40/47] can: bittiming: factor out can_sjw_set_default() and can_sjw_check() Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 41/47] can: bittiming: can_fixup_bittiming(): report error via netlink and harmonize error value Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 42/47] can: bittiming: can_sjw_check(): " Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 43/47] can: bittiming: can_sjw_check(): check that SJW is not longer than either Phase Buffer Segment Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 44/47] can: bittiming: can_sjw_set_default(): use Phase Seg2 / 2 as default for SJW Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 45/47] can: bittiming: can_calc_bittiming(): clean up SJW handling Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 46/47] can: bittiming: can_calc_bittiming(): convert from netdev_err() to NL_SET_ERR_MSG_FMT() Marc Kleine-Budde
2023-02-06 13:16 ` [PATCH net-next 47/47] can: bittiming: can_validate_bitrate(): report error via netlink Marc Kleine-Budde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230206131620.2758724-16-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=uttenthaler@ems-wuensche.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).