|
@@ -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;
|