summaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_macio.c
diff options
context:
space:
mode:
authorMarkus Elfring2018-02-16 13:01:45 +0100
committerTejun Heo2018-02-18 14:24:16 +0100
commit3e342770a22b84c0246719d22c318c22ae2f782a (patch)
tree402ad94aebc7ed34ec4be8c709dc0dea24e5662b /drivers/ata/pata_macio.c
parentpata_mpc52xx: Delete an error message for a failed memory allocation in mpc52... (diff)
downloadkernel-qcow2-linux-3e342770a22b84c0246719d22c318c22ae2f782a.tar.gz
kernel-qcow2-linux-3e342770a22b84c0246719d22c318c22ae2f782a.tar.xz
kernel-qcow2-linux-3e342770a22b84c0246719d22c318c22ae2f782a.zip
pata_macio: Delete an error message for a failed memory allocation in two functions
Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/pata_macio.c')
-rw-r--r--drivers/ata/pata_macio.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
index 0adcb40d2794..9588e685d994 100644
--- a/drivers/ata/pata_macio.c
+++ b/drivers/ata/pata_macio.c
@@ -1131,11 +1131,9 @@ static int pata_macio_attach(struct macio_dev *mdev,
/* Allocate and init private data structure */
priv = devm_kzalloc(&mdev->ofdev.dev,
sizeof(struct pata_macio_priv), GFP_KERNEL);
- if (priv == NULL) {
- dev_err(&mdev->ofdev.dev,
- "Failed to allocate private memory\n");
+ if (!priv)
return -ENOMEM;
- }
+
priv->node = of_node_get(mdev->ofdev.dev.of_node);
priv->mdev = mdev;
priv->dev = &mdev->ofdev.dev;
@@ -1277,11 +1275,9 @@ static int pata_macio_pci_attach(struct pci_dev *pdev,
/* Allocate and init private data structure */
priv = devm_kzalloc(&pdev->dev,
sizeof(struct pata_macio_priv), GFP_KERNEL);
- if (priv == NULL) {
- dev_err(&pdev->dev,
- "Failed to allocate private memory\n");
+ if (!priv)
return -ENOMEM;
- }
+
priv->node = of_node_get(np);
priv->pdev = pdev;
priv->dev = &pdev->dev;