aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 15:13:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-05 15:13:47 -0500
commit9bd9fa6c147e68fc4dc3b35893979720ba7d0321 (patch)
treece23c872fda3002495354b7bb75e6399873b0f4e
parentb0378657549bbc73ac0ec6e9332fcf3c53362365 (diff)
parent16bd5865cdb3b190105db21bd22a0ca0501e7b20 (diff)
Merge tag 'hsi-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi
Pull HSI updates from Sebastian Reichel: "Misc fixes" * tag 'hsi-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi: hsi: controllers:remove redundant code hsi: correctly handle return value of kzalloc hsi: omap_ssi_port: Prevent warning if cawake_gpio is not defined. hsi: fix double kfree HSI: Fix a typo
-rw-r--r--drivers/hsi/clients/ssi_protocol.c2
-rw-r--r--drivers/hsi/controllers/omap_ssi.c21
-rw-r--r--drivers/hsi/controllers/omap_ssi_port.c2
-rw-r--r--drivers/hsi/hsi.c13
4 files changed, 17 insertions, 21 deletions
diff --git a/drivers/hsi/clients/ssi_protocol.c b/drivers/hsi/clients/ssi_protocol.c
index e5c7a969f28b..a38af68cf326 100644
--- a/drivers/hsi/clients/ssi_protocol.c
+++ b/drivers/hsi/clients/ssi_protocol.c
@@ -783,7 +783,7 @@ static void ssip_rx_strans(struct hsi_client *cl, u32 cmd)
783 } 783 }
784 ssip_set_rxstate(ssi, RECEIVING); 784 ssip_set_rxstate(ssi, RECEIVING);
785 if (unlikely(SSIP_MSG_ID(cmd) != ssi->rxid)) { 785 if (unlikely(SSIP_MSG_ID(cmd) != ssi->rxid)) {
786 dev_err(&cl->device, "START TRANS id %d expeceted %d\n", 786 dev_err(&cl->device, "START TRANS id %d expected %d\n",
787 SSIP_MSG_ID(cmd), ssi->rxid); 787 SSIP_MSG_ID(cmd), ssi->rxid);
788 spin_unlock(&ssi->lock); 788 spin_unlock(&ssi->lock);
789 goto out1; 789 goto out1;
diff --git a/drivers/hsi/controllers/omap_ssi.c b/drivers/hsi/controllers/omap_ssi.c
index 089c6c3feb3e..f6d3100b7a32 100644
--- a/drivers/hsi/controllers/omap_ssi.c
+++ b/drivers/hsi/controllers/omap_ssi.c
@@ -295,27 +295,14 @@ static int __init ssi_get_iomem(struct platform_device *pd,
295 const char *name, void __iomem **pbase, dma_addr_t *phy) 295 const char *name, void __iomem **pbase, dma_addr_t *phy)
296{ 296{
297 struct resource *mem; 297 struct resource *mem;
298 struct resource *ioarea;
299 void __iomem *base; 298 void __iomem *base;
300 struct hsi_controller *ssi = platform_get_drvdata(pd); 299 struct hsi_controller *ssi = platform_get_drvdata(pd);
301 300
302 mem = platform_get_resource_byname(pd, IORESOURCE_MEM, name); 301 mem = platform_get_resource_byname(pd, IORESOURCE_MEM, name);
303 if (!mem) { 302 base = devm_ioremap_resource(&ssi->device, mem);
304 dev_err(&pd->dev, "IO memory region missing (%s)\n", name); 303 if (IS_ERR(base))
305 return -ENXIO; 304 return PTR_ERR(base);
306 } 305
307 ioarea = devm_request_mem_region(&ssi->device, mem->start,
308 resource_size(mem), dev_name(&pd->dev));
309 if (!ioarea) {
310 dev_err(&pd->dev, "%s IO memory region request failed\n",
311 mem->name);
312 return -ENXIO;
313 }
314 base = devm_ioremap(&ssi->device, mem->start, resource_size(mem));
315 if (!base) {
316 dev_err(&pd->dev, "%s IO remap failed\n", mem->name);
317 return -ENXIO;
318 }
319 *pbase = base; 306 *pbase = base;
320 307
321 if (phy) 308 if (phy)
diff --git a/drivers/hsi/controllers/omap_ssi_port.c b/drivers/hsi/controllers/omap_ssi_port.c
index 1f8652b3de06..02e66032ae73 100644
--- a/drivers/hsi/controllers/omap_ssi_port.c
+++ b/drivers/hsi/controllers/omap_ssi_port.c
@@ -1111,7 +1111,7 @@ static int __init ssi_port_probe(struct platform_device *pd)
1111 struct omap_ssi_port *omap_port; 1111 struct omap_ssi_port *omap_port;
1112 struct hsi_controller *ssi = dev_get_drvdata(pd->dev.parent); 1112 struct hsi_controller *ssi = dev_get_drvdata(pd->dev.parent);
1113 struct omap_ssi_controller *omap_ssi = hsi_controller_drvdata(ssi); 1113 struct omap_ssi_controller *omap_ssi = hsi_controller_drvdata(ssi);
1114 u32 cawake_gpio = 0; 1114 int cawake_gpio = 0;
1115 u32 port_id; 1115 u32 port_id;
1116 int err; 1116 int err;
1117 1117
diff --git a/drivers/hsi/hsi.c b/drivers/hsi/hsi.c
index fe9371271ce2..df380d55c58f 100644
--- a/drivers/hsi/hsi.c
+++ b/drivers/hsi/hsi.c
@@ -85,12 +85,14 @@ struct hsi_client *hsi_new_client(struct hsi_port *port,
85 85
86 cl = kzalloc(sizeof(*cl), GFP_KERNEL); 86 cl = kzalloc(sizeof(*cl), GFP_KERNEL);
87 if (!cl) 87 if (!cl)
88 return NULL; 88 goto err;
89 89
90 cl->tx_cfg = info->tx_cfg; 90 cl->tx_cfg = info->tx_cfg;
91 if (cl->tx_cfg.channels) { 91 if (cl->tx_cfg.channels) {
92 size = cl->tx_cfg.num_channels * sizeof(*cl->tx_cfg.channels); 92 size = cl->tx_cfg.num_channels * sizeof(*cl->tx_cfg.channels);
93 cl->tx_cfg.channels = kzalloc(size , GFP_KERNEL); 93 cl->tx_cfg.channels = kzalloc(size , GFP_KERNEL);
94 if (!cl->tx_cfg.channels)
95 goto err_tx;
94 memcpy(cl->tx_cfg.channels, info->tx_cfg.channels, size); 96 memcpy(cl->tx_cfg.channels, info->tx_cfg.channels, size);
95 } 97 }
96 98
@@ -98,6 +100,8 @@ struct hsi_client *hsi_new_client(struct hsi_port *port,
98 if (cl->rx_cfg.channels) { 100 if (cl->rx_cfg.channels) {
99 size = cl->rx_cfg.num_channels * sizeof(*cl->rx_cfg.channels); 101 size = cl->rx_cfg.num_channels * sizeof(*cl->rx_cfg.channels);
100 cl->rx_cfg.channels = kzalloc(size , GFP_KERNEL); 102 cl->rx_cfg.channels = kzalloc(size , GFP_KERNEL);
103 if (!cl->rx_cfg.channels)
104 goto err_rx;
101 memcpy(cl->rx_cfg.channels, info->rx_cfg.channels, size); 105 memcpy(cl->rx_cfg.channels, info->rx_cfg.channels, size);
102 } 106 }
103 107
@@ -114,6 +118,12 @@ struct hsi_client *hsi_new_client(struct hsi_port *port,
114 } 118 }
115 119
116 return cl; 120 return cl;
121err_rx:
122 kfree(cl->tx_cfg.channels);
123err_tx:
124 kfree(cl);
125err:
126 return NULL;
117} 127}
118EXPORT_SYMBOL_GPL(hsi_new_client); 128EXPORT_SYMBOL_GPL(hsi_new_client);
119 129
@@ -300,7 +310,6 @@ static void hsi_add_client_from_dt(struct hsi_port *port,
300 if (device_register(&cl->device) < 0) { 310 if (device_register(&cl->device) < 0) {
301 pr_err("hsi: failed to register client: %s\n", name); 311 pr_err("hsi: failed to register client: %s\n", name);
302 put_device(&cl->device); 312 put_device(&cl->device);
303 goto err3;
304 } 313 }
305 314
306 return; 315 return;