Re: [PATCH] staging: nvec: insert blank lines after declarations
Am Donnerstag, 3. Juli 2014, 21:15:57 schrieb Pawel Lebioda: > Hi, > > This patch fixes coding style warnings reported by checkpatch.pl: > "Missing a blank line after declarations". thanks. Looking at the checkpatch output, its requirement of at least 4 lines of help text looks like a bit overkill though. > Signed-off-by: Pawel Lebioda > drivers/staging/nvec/nvec_paz00.c | 1 + > drivers/staging/nvec/nvec_power.c | 1 + > drivers/staging/nvec/nvec_ps2.c | 2 ++ > 3 files changed, 4 insertions(+) Acked-by: Marc Dietrich signature.asc Description: This is a digitally signed message part. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RFC] [HELP] [WMI] Media keys on MSI GE60 (patching msi_wmi for it)
Hi there! I'm trying to modify msi_wmi driver to get it work with mediakeys on my MSI GE60 laptop. By default, I get "Unknown event received" message. For now, I diagnosed that event, that every key press produces has 0x03 ( ACPI_TYPE_BUFFER?) type, instead of 0x01 (ACPI_TYPE_INTEGER) which in-kernel msi_wmi module wants. Further diagnostic with that code: 232 › } else if (obj && obj->type == ACPI_TYPE_BUFFER) { 233 › › int eventcode = obj->integer.value; 234 › › pr_info("Eventcode: 0x%x\n", eventcode); 235 › › key = sparse_keymap_entry_from_scancode(msi_wmi_input_dev, 236 › › › › eventcode); 237 › › if (!key) { 238 › › › pr_info("Unknown key pressed - %x\n", eventcode); 239 › › › goto msi_wmi_notify_exit; 240 › › } 241 242 › › pr_info("%d\n",key->type); 243 › } else 244 › › pr_info("Unknown event received\n"); (only patched part) Gives me following info: Wen I press on any of media-keys — I get the same eventcode (and every time I get if(!key) error. Moreover, evencode value changes in time (something about 4 seconds), so, if I'll press some key many times, eventcode value will be changed after 4s, but it will not change if I press another mediakeys. Can anybody advice me, why can I experience such behaviour? And is it a way to get mediakeys working without patching DSDT (last time I did that I brake my bluetooth module in that way, that even rfkill was unable to enable it :P)? -- Best regsrds, mva signature.asc Description: This is a digitally signed message part. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH RFC] imx-drm: convert imx-drm to use the generic DRM OF helper
Hi Russell, Am Donnerstag, den 03.07.2014, 17:52 +0100 schrieb Russell King: > Use the generic DRM OF helper to locate the possible CRTCs for the > encoder, thereby shrinking the imx-drm driver some more. Great, I especially like that now we don't go -EPROBE_DEFER anymore as soon as a single crtc_mask doesn't check out so we can also start adding output endpoints to encoders. > Signed-off-by: Russell King > --- > This patch builds upon "drm: add of_graph endpoint helper to find > possible CRTCs", converting imx-drm to use this new helper. There's a reference counting issue in the patch mentioned above, but I'd like to fix this in of_graph_get_next_endpoint instead. For both patches, Acked-by: Philipp Zabel regards Philipp ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/5] imx-drm: use for_each_endpoint_of_node macro in imx_drm_encoder_get_mux_id
Using the for_each_... macro should make the code bit shorter and easier to read. This patch also properly decrements the endpoint node reference count before returning out of the loop. Signed-off-by: Philipp Zabel --- drivers/staging/imx-drm/imx-drm-core.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c index e6663dd..4881fd9 100644 --- a/drivers/staging/imx-drm/imx-drm-core.c +++ b/drivers/staging/imx-drm/imx-drm-core.c @@ -447,18 +447,15 @@ int imx_drm_encoder_get_mux_id(struct device_node *node, if (!node || !imx_crtc) return -EINVAL; - do { - ep = of_graph_get_next_endpoint(node, ep); - if (!ep) - break; - + for_each_endpoint_of_node(node, ep) { port = of_graph_get_remote_port(ep); of_node_put(port); if (port == imx_crtc->crtc->port) { ret = of_graph_parse_endpoint(ep, &endpoint); + of_node_put(ep); return ret ? ret : endpoint.port; } - } while (ep); + } return -EINVAL; } -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/5] of: Add for_each_endpoint_of_node helper macro
Note that while of_graph_get_next_endpoint decrements the reference count of the child node passed to it, of_node_put(child) still has to be called manually when breaking out of the loop. Signed-off-by: Philipp Zabel --- include/linux/of_graph.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h index befef42..c5ef5fa 100644 --- a/include/linux/of_graph.h +++ b/include/linux/of_graph.h @@ -26,6 +26,10 @@ struct of_endpoint { const struct device_node *local_node; }; +#define for_each_endpoint_of_node(parent, child) \ + for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \ +child = of_graph_get_next_endpoint(parent, child)) + #ifdef CONFIG_OF int of_graph_parse_endpoint(const struct device_node *node, struct of_endpoint *endpoint); -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/5] of: Decrement refcount of previous endpoint in of_graph_get_next_endpoint
Decreasing the reference count of the previous endpoint node allows to use the of_graph_get_next_endpoint function in a for_each_... style macro. Signed-off-by: Philipp Zabel --- drivers/of/base.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 8368d96..9480e10 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -2262,8 +2262,7 @@ EXPORT_SYMBOL(of_graph_parse_endpoint); * @prev: previous endpoint node, or NULL to get first * * Return: An 'endpoint' node pointer with refcount incremented. Refcount - * of the passed @prev node is not decremented, the caller have to use - * of_node_put() on it when done. + * of the passed @prev node is decremented. */ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, struct device_node *prev) @@ -2299,12 +2298,6 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, if (WARN_ONCE(!port, "%s(): endpoint %s has no parent node\n", __func__, prev->full_name)) return NULL; - - /* -* Avoid dropping prev node refcount to 0 when getting the next -* child below. -*/ - of_node_get(prev); } while (1) { -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/5] drm: use for_each_endpoint_of_node macro in drm_of_find_possible_crtcs
Using the for_each_... macro should make the code a bit shorter and easier to read. Signed-off-by: Philipp Zabel --- drivers/gpu/drm/drm_of.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 46d9678..1b315b6 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -44,11 +44,7 @@ uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, struct device_node *remote_port, *ep = NULL; uint32_t possible_crtcs = 0; - do { - ep = of_graph_get_next_endpoint(port, ep); - if (!ep) - break; - + for_each_endpoint_of_node(port, ep) { remote_port = of_graph_get_remote_port(ep); if (!remote_port) { of_node_put(ep); @@ -58,7 +54,7 @@ uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, possible_crtcs |= drm_crtc_port_mask(dev, remote_port); of_node_put(remote_port); - } while (1); + } return possible_crtcs; } -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/5] Iterate of_graph endpoints using a for_each_... style macro
Hi, decrementing the reference count of the previous endpoint node parameter to of_graph_get_next_endpoint allows to wrap the function in a for_each macro. This series removes the remaining workaround in imx-drm, adds the macro for_each_endpoint_of_node, and switches the current users to it. It builds upon Russell's patches: "drm: add of_graph endpoint helper to find possible CRTCs" and "imx-drm: convert imx-drm to use the generic DRM OF helper" regards Philipp Philipp Zabel (5): imx-drm: Drop imx_drm_of_get_next_endpoint wrapper of: Decrement refcount of previous endpoint in of_graph_get_next_endpoint of: Add for_each_endpoint_of_node helper macro drm: use for_each_endpoint_of_node macro in drm_of_find_possible_crtcs imx-drm: use for_each_endpoint_of_node macro in imx_drm_encoder_get_mux_id drivers/gpu/drm/drm_of.c | 8 ++-- drivers/of/base.c | 9 + drivers/staging/imx-drm/imx-drm-core.c | 17 +++-- include/linux/of_graph.h | 4 4 files changed, 10 insertions(+), 28 deletions(-) -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/5] imx-drm: Drop imx_drm_of_get_next_endpoint wrapper
We will decrease the prev node reference count in of_graph_get_next_endpoint instead. Signed-off-by: Philipp Zabel --- drivers/staging/imx-drm/imx-drm-core.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/imx-drm/imx-drm-core.c b/drivers/staging/imx-drm/imx-drm-core.c index a5d05b4..e6663dd 100644 --- a/drivers/staging/imx-drm/imx-drm-core.c +++ b/drivers/staging/imx-drm/imx-drm-core.c @@ -408,14 +408,6 @@ int imx_drm_remove_crtc(struct imx_drm_crtc *imx_drm_crtc) } EXPORT_SYMBOL_GPL(imx_drm_remove_crtc); -static struct device_node *imx_drm_of_get_next_endpoint( - const struct device_node *parent, struct device_node *prev) -{ - struct device_node *node = of_graph_get_next_endpoint(parent, prev); - of_node_put(prev); - return node; -} - int imx_drm_encoder_parse_of(struct drm_device *drm, struct drm_encoder *encoder, struct device_node *np) { @@ -456,7 +448,7 @@ int imx_drm_encoder_get_mux_id(struct device_node *node, return -EINVAL; do { - ep = imx_drm_of_get_next_endpoint(node, ep); + ep = of_graph_get_next_endpoint(node, ep); if (!ep) break; -- 2.0.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: dgap: remove unneccessary dgap_init_pci() function
The dgap_init_pci() calls only pci_register_driver(). It doesn't need to make a function for that. Signed-off-by: Daeseok Youn --- drivers/staging/dgap/dgap.c | 11 +-- 1 files changed, 1 insertions(+), 10 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 5bccd14..b193d20 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -74,7 +74,6 @@ static struct board_t *dgap_found_board(struct pci_dev *pdev, int id, int boardnum); static void dgap_cleanup_board(struct board_t *brd); static void dgap_poll_handler(ulong dummy); -static int dgap_init_pci(void); static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); static void dgap_remove_one(struct pci_dev *dev); static int dgap_do_remap(struct board_t *brd); @@ -479,7 +478,7 @@ static int dgap_init_module(void) if (rc) return rc; - rc = dgap_init_pci(); + rc = pci_register_driver(&dgap_driver); if (rc) goto err_cleanup; @@ -563,14 +562,6 @@ failed_class: return rc; } -/* - * Register pci driver, and return how many boards we have. - */ -static int dgap_init_pci(void) -{ - return pci_register_driver(&dgap_driver); -} - static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { int rc; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: dgap: remove unused waitqueues
dgap_dl_wait and kme_wait are not used in dgap. Signed-off-by: Daeseok Youn --- drivers/staging/dgap/dgap.c |8 drivers/staging/dgap/dgap.h |1 - 2 files changed, 0 insertions(+), 9 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index b193d20..e8d3c99 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -218,7 +218,6 @@ static uint dgap_numboards; static struct board_t *dgap_board[MAXBOARDS]; static ulong dgap_poll_counter; static int dgap_driver_state = DRIVER_INITIALIZED; -static wait_queue_head_t dgap_dl_wait; static int dgap_poll_tick = 20;/* Poll interval - 20 ms */ static struct class *dgap_class; @@ -1200,8 +1199,6 @@ static void dgap_init_globals(void) dgap_board[i] = NULL; init_timer(&dgap_poll_timer); - - init_waitqueue_head(&dgap_dl_wait); } / @@ -4162,11 +4159,6 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, static int dgap_alloc_flipbuf(struct board_t *brd) { /* -* Initialize KME waitqueues... -*/ - init_waitqueue_head(&brd->kme_wait); - - /* * allocate flip buffer for board. */ brd->flipbuf = kmalloc(MYFLIPLEN, GFP_KERNEL); diff --git a/drivers/staging/dgap/dgap.h b/drivers/staging/dgap/dgap.h index c00b2e2..9728d59 100644 --- a/drivers/staging/dgap/dgap.h +++ b/drivers/staging/dgap/dgap.h @@ -603,7 +603,6 @@ struct board_t { /* by DPA */ u16 dpastatus; /* The board "status", as defined */ /* by DPA */ - wait_queue_head_t kme_wait; /* Needed for DPA support */ u32 conc_dl_status; /* Status of any pending conc */ /* download */ -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 3/8] component: add support for component match array
Hi Russell > Add support for generating a set of component matches at master probe > time, and submitting them to the component layer. This allows the > component layer to perform the matches internally without needing to > call into the master driver, and allows for further restructuring of > the component helper. > > Signed-off-by: Russell King > --- [snip] > +int component_master_add_with_match(struct device *dev, > + const struct component_master_ops *ops, > + struct component_match *match) > { > struct master *master; > int ret; > > + if (ops->add_components && match) > + return -EINVAL; > + > + /* Reallocate the match array for its true size */ > + match = component_match_realloc(dev, match, match->num); ^ This gives a NULL pointer dereference error when match is NULL (as passed by component_master_add() below). Observed this while testing linux-next kernel (next-20140704) on Exynos based board with DRM enabled. > + if (IS_ERR(match)) > + return PTR_ERR(match); > + > master = kzalloc(sizeof(*master), GFP_KERNEL); > if (!master) > return -ENOMEM; > > master->dev = dev; > master->ops = ops; > + master->match = match; > INIT_LIST_HEAD(&master->components); > > /* Add to the list of available masters. */ > @@ -215,6 +322,13 @@ int component_master_add(struct device *dev, > > return ret < 0 ? ret : 0; > } > +EXPORT_SYMBOL_GPL(component_master_add_with_match); > + > +int component_master_add(struct device *dev, > + const struct component_master_ops *ops) > +{ > + return component_master_add_with_match(dev, ops, NULL); > +} > EXPORT_SYMBOL_GPL(component_master_add); -- Regards, Sachin. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 3/8] component: add support for component match array
On Fri, Jul 04, 2014 at 04:17:35PM +0530, Sachin Kamat wrote: > Hi Russell > > > +int component_master_add_with_match(struct device *dev, > > + const struct component_master_ops *ops, > > + struct component_match *match) > > { > > struct master *master; > > int ret; > > > > + if (ops->add_components && match) > > + return -EINVAL; > > + > > + /* Reallocate the match array for its true size */ > > + match = component_match_realloc(dev, match, match->num); > >^ > This gives a NULL pointer dereference error when match is NULL (as passed > by component_master_add() below). Observed this while testing linux-next > kernel (next-20140704) on Exynos based board with DRM enabled. Thanks for your report. Please verify that the patch below resolves it for you. Thanks. drivers/base/component.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/base/component.c b/drivers/base/component.c index b4236daed4fa..f748430bb654 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -293,10 +293,12 @@ int component_master_add_with_match(struct device *dev, if (ops->add_components && match) return -EINVAL; - /* Reallocate the match array for its true size */ - match = component_match_realloc(dev, match, match->num); - if (IS_ERR(match)) - return PTR_ERR(match); + if (match) { + /* Reallocate the match array for its true size */ + match = component_match_realloc(dev, match, match->num); + if (IS_ERR(match)) + return PTR_ERR(match); + } master = kzalloc(sizeof(*master), GFP_KERNEL); if (!master) -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 3/8] component: add support for component match array
On Fri, Jul 4, 2014 at 4:22 PM, Russell King - ARM Linux wrote: > On Fri, Jul 04, 2014 at 04:17:35PM +0530, Sachin Kamat wrote: >> Hi Russell >> >> > +int component_master_add_with_match(struct device *dev, >> > + const struct component_master_ops *ops, >> > + struct component_match *match) >> > { >> > struct master *master; >> > int ret; >> > >> > + if (ops->add_components && match) >> > + return -EINVAL; >> > + >> > + /* Reallocate the match array for its true size */ >> > + match = component_match_realloc(dev, match, match->num); >> >>^ >> This gives a NULL pointer dereference error when match is NULL (as passed >> by component_master_add() below). Observed this while testing linux-next >> kernel (next-20140704) on Exynos based board with DRM enabled. > > Thanks for your report. Please verify that the patch below resolves it > for you. Thanks. Yes, the below patch fixes the crash. Thanks for the fix. > > drivers/base/component.c | 10 ++ > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/base/component.c b/drivers/base/component.c > index b4236daed4fa..f748430bb654 100644 > --- a/drivers/base/component.c > +++ b/drivers/base/component.c > @@ -293,10 +293,12 @@ int component_master_add_with_match(struct device *dev, > if (ops->add_components && match) > return -EINVAL; > > - /* Reallocate the match array for its true size */ > - match = component_match_realloc(dev, match, match->num); > - if (IS_ERR(match)) > - return PTR_ERR(match); > + if (match) { > + /* Reallocate the match array for its true size */ > + match = component_match_realloc(dev, match, match->num); > + if (IS_ERR(match)) > + return PTR_ERR(match); > + } > > master = kzalloc(sizeof(*master), GFP_KERNEL); > if (!master) > > > -- > FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly > improving, and getting towards what was expected from it. -- Regards, Sachin. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 3/8] component: add support for component match array
On Fri, Jul 04, 2014 at 05:00:36PM +0530, Sachin Kamat wrote: > On Fri, Jul 4, 2014 at 4:22 PM, Russell King - ARM Linux > wrote: > > On Fri, Jul 04, 2014 at 04:17:35PM +0530, Sachin Kamat wrote: > >> Hi Russell > >> > >> > +int component_master_add_with_match(struct device *dev, > >> > + const struct component_master_ops *ops, > >> > + struct component_match *match) > >> > { > >> > struct master *master; > >> > int ret; > >> > > >> > + if (ops->add_components && match) > >> > + return -EINVAL; > >> > + > >> > + /* Reallocate the match array for its true size */ > >> > + match = component_match_realloc(dev, match, match->num); > >> > >> ^ > >> This gives a NULL pointer dereference error when match is NULL (as passed > >> by component_master_add() below). Observed this while testing linux-next > >> kernel (next-20140704) on Exynos based board with DRM enabled. > > > > Thanks for your report. Please verify that the patch below resolves it > > for you. Thanks. > > Yes, the below patch fixes the crash. Thanks for the fix. Thanks. I'll add a tested-by and reported-by for your address when committing this patch. Let me know if you want something different. -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 3/8] component: add support for component match array
On Fri, Jul 4, 2014 at 5:55 PM, Russell King - ARM Linux wrote: > On Fri, Jul 04, 2014 at 05:00:36PM +0530, Sachin Kamat wrote: >> On Fri, Jul 4, 2014 at 4:22 PM, Russell King - ARM Linux >> wrote: >> > On Fri, Jul 04, 2014 at 04:17:35PM +0530, Sachin Kamat wrote: >> >> Hi Russell >> >> >> >> > +int component_master_add_with_match(struct device *dev, >> >> > + const struct component_master_ops *ops, >> >> > + struct component_match *match) >> >> > { >> >> > struct master *master; >> >> > int ret; >> >> > >> >> > + if (ops->add_components && match) >> >> > + return -EINVAL; >> >> > + >> >> > + /* Reallocate the match array for its true size */ >> >> > + match = component_match_realloc(dev, match, match->num); >> >> >> >>^ >> >> This gives a NULL pointer dereference error when match is NULL (as passed >> >> by component_master_add() below). Observed this while testing linux-next >> >> kernel (next-20140704) on Exynos based board with DRM enabled. >> > >> > Thanks for your report. Please verify that the patch below resolves it >> > for you. Thanks. >> >> Yes, the below patch fixes the crash. Thanks for the fix. > > Thanks. I'll add a tested-by and reported-by for your address when > committing this patch. Let me know if you want something different. Thanks. Please use the following for the tags: Sachin Kamat -- Regards, Sachin. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: goldfish: Introduce the use of managed interfaces
This patch introduces the use of managed interfaces like devm_kzalloc, devm_ioremap, dmam_alloc_coherent, devm_request_irq and does away with the calls to functions to free the allocated memory in the probe and remove functions. Also, the labels are removed in the probe function. Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall --- drivers/staging/goldfish/goldfish_audio.c | 53 --- 1 file changed, 13 insertions(+), 40 deletions(-) diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c index a166424..9df4ad8 100644 --- a/drivers/staging/goldfish/goldfish_audio.c +++ b/drivers/staging/goldfish/goldfish_audio.c @@ -274,11 +274,9 @@ static int goldfish_audio_probe(struct platform_device *pdev) struct goldfish_audio *data; dma_addr_t buf_addr; - data = kzalloc(sizeof(*data), GFP_KERNEL); - if (data == NULL) { - ret = -ENOMEM; - goto err_data_alloc_failed; - } + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); + if (data == NULL) + return -ENOMEM; spin_lock_init(&data->lock); init_waitqueue_head(&data->wait); platform_set_drvdata(pdev, data); @@ -286,38 +284,33 @@ static int goldfish_audio_probe(struct platform_device *pdev) r = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (r == NULL) { dev_err(&pdev->dev, "platform_get_resource failed\n"); - ret = -ENODEV; - goto err_no_io_base; - } - data->reg_base = ioremap(r->start, PAGE_SIZE); - if (data->reg_base == NULL) { - ret = -ENOMEM; - goto err_no_io_base; + return -ENODEV; } + data->reg_base = devm_ioremap(&pdev->dev, r->start, PAGE_SIZE); + if (data->reg_base == NULL) + return -ENOMEM; data->irq = platform_get_irq(pdev, 0); if (data->irq < 0) { dev_err(&pdev->dev, "platform_get_irq failed\n"); - ret = -ENODEV; - goto err_no_irq; + return -ENODEV; } - data->buffer_virt = dma_alloc_coherent(&pdev->dev, + data->buffer_virt = dmam_alloc_coherent(&pdev->dev, COMBINED_BUFFER_SIZE, &buf_addr, GFP_KERNEL); if (data->buffer_virt == 0) { - ret = -ENOMEM; dev_err(&pdev->dev, "allocate buffer failed\n"); - goto err_alloc_write_buffer_failed; + return -ENOMEM; } data->buffer_phys = buf_addr; data->write_buffer1 = data->buffer_virt; data->write_buffer2 = data->buffer_virt + WRITE_BUFFER_SIZE; data->read_buffer = data->buffer_virt + 2 * WRITE_BUFFER_SIZE; - ret = request_irq(data->irq, goldfish_audio_interrupt, + ret = devm_request_irq(&pdev->dev, data->irq, goldfish_audio_interrupt, IRQF_SHARED, pdev->name, data); if (ret) { dev_err(&pdev->dev, "request_irq failed\n"); - goto err_request_irq_failed; + return ret; } ret = misc_register(&goldfish_audio_device); @@ -325,7 +318,7 @@ static int goldfish_audio_probe(struct platform_device *pdev) dev_err(&pdev->dev, "misc_register returned %d in goldfish_audio_init\n", ret); - goto err_misc_register_failed; + return ret; } AUDIO_WRITE64(data, AUDIO_SET_WRITE_BUFFER_1, @@ -344,31 +337,11 @@ static int goldfish_audio_probe(struct platform_device *pdev) audio_data = data; return 0; - -err_misc_register_failed: - free_irq(data->irq, data); -err_request_irq_failed: - dma_free_coherent(&pdev->dev, COMBINED_BUFFER_SIZE, - data->buffer_virt, data->buffer_phys); -err_alloc_write_buffer_failed: -err_no_irq: - iounmap(data->reg_base); -err_no_io_base: - kfree(data); -err_data_alloc_failed: - return ret; } static int goldfish_audio_remove(struct platform_device *pdev) { - struct goldfish_audio *data = platform_get_drvdata(pdev); - misc_deregister(&goldfish_audio_device); - free_irq(data->irq, data); - dma_free_coherent(&pdev->dev, COMBINED_BUFFER_SIZE, - data->buffer_virt, data->buffer_phys); - iounmap(data->reg_base); - kfree(data); audio_data = NULL; return 0; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Status of RMI4 drivers?
Hi, I'm going over some "older" drivers in the staging tree and wanted to ask about cptm1217 and ste_rmi4. They've been in staging for three and a half years now, waiting for the upstream Synaptics RMI4 drivers. From what I understand, the RMI4 development is happening in the synaptics-rmi4 branch of Dmitry's git tree. Does anyone have any idea when the RMI4 code might be "ready" and get merged properly? How is that going? Thanks, Kristina ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: nvec: remove unneccessary 'else' after 'return' statement
Hi, This patch fixes the following warning reported by checkpatch.pl: WARNING: else is not generally useful after a break or return #235: FILE: drivers/staging/nvec/nvec.c:235: Regards Pawel Lebioda Signed-off-by: Pawel Lebioda drivers/staging/nvec/nvec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 90f1c4d..8a3dd47 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -232,8 +232,7 @@ static size_t nvec_msg_size(struct nvec_msg *msg) return 2; else if (event_length == NVEC_3BYTES) return 3; - else - return 0; + return 0; } /** ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] staging: cxt1e1: remove null test before kfree
Fix checkpatch warning: WARNING: kfree(NULL) is safe this check is probably not required Cc: Greg Kroah-Hartman Cc: Daeseok Youn Cc: de...@driverdev.osuosl.org Signed-off-by: Fabian Frederick --- drivers/staging/cxt1e1/pmcc4_drv.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/cxt1e1/pmcc4_drv.c b/drivers/staging/cxt1e1/pmcc4_drv.c index 76bebdd..e738264 100644 --- a/drivers/staging/cxt1e1/pmcc4_drv.c +++ b/drivers/staging/cxt1e1/pmcc4_drv.c @@ -454,10 +454,7 @@ c4_cleanup (void) pi = &ci->port[portnum]; c4_wq_port_cleanup (pi); for (j = 0; j < MUSYCC_NCHANS; j++) -{ -if (pi->chan[j]) -kfree(pi->chan[j]); /* free mch_t struct */ -} +kfree(pi->chan[j]); /* free mch_t struct */ kfree(pi->regram_saved); } kfree(ci->iqd_p_saved); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: nvec: remove unneccessary 'out of memory' message
Hi, This patch fixes the following warning reported by checkpatch.pl: WARNING: Possible unnecessary 'out of memory' message #811: FILE: drivers/staging/nvec/nvec.c:811 Regards Pawel Lebioda Signed-off-by: Pawel Lebioda drivers/staging/nvec/nvec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 90f1c4d..70109f6 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -807,10 +807,9 @@ static int tegra_nvec_probe(struct platform_device *pdev) } nvec = devm_kzalloc(&pdev->dev, sizeof(struct nvec_chip), GFP_KERNEL); - if (nvec == NULL) { - dev_err(&pdev->dev, "failed to reserve memory\n"); + if (nvec == NULL) return -ENOMEM; - } + platform_set_drvdata(pdev, nvec); nvec->dev = &pdev->dev; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: bcm: add missing blank lines after declarations
Hi, This patch fixes almost all 'missing blank line after declaration' warnings reported by checkpatch.pl for drivers/staging/bcm. Regards Pawel Lebioda Signed-off-by: Pawel Lebioda drivers/staging/bcm/CmHost.c| 1 + drivers/staging/bcm/IPv6Protocol.c | 6 ++ drivers/staging/bcm/InterfaceDld.c | 1 + drivers/staging/bcm/InterfaceInit.c | 1 + drivers/staging/bcm/InterfaceMisc.c | 1 + drivers/staging/bcm/InterfaceTx.c | 2 +- drivers/staging/bcm/PHSModule.c | 1 + drivers/staging/bcm/Qos.c | 9 - drivers/staging/bcm/Transmit.c | 1 + drivers/staging/bcm/led_control.c | 4 drivers/staging/bcm/nvm.c | 6 ++ 11 files changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c index 3dbdf0e..adca0ce 100644 --- a/drivers/staging/bcm/CmHost.c +++ b/drivers/staging/bcm/CmHost.c @@ -972,6 +972,7 @@ static VOID DumpCmControlPacket(PVOID pvBuffer) pstAddIndication->sfAuthorizedSet.bValid = 1; for (nIndex = 0; nIndex < nCurClassifierCnt; nIndex++) { struct bcm_convergence_types *psfCSType = NULL; + psfCSType = &pstAddIndication->sfAuthorizedSet.cConvergenceSLTypes[nIndex]; BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, DUMP_CONTROL, DBG_LVL_ALL, "psfCSType = %p", psfCSType); diff --git a/drivers/staging/bcm/IPv6Protocol.c b/drivers/staging/bcm/IPv6Protocol.c index cd16067..e013c5a 100644 --- a/drivers/staging/bcm/IPv6Protocol.c +++ b/drivers/staging/bcm/IPv6Protocol.c @@ -45,6 +45,7 @@ static UCHAR *GetNextIPV6ChainedHeader(UCHAR **ppucPayload, case IPV6HDR_TYPE_ROUTING: { struct bcm_ipv6_routing_hdr *pstIpv6RoutingHeader; + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, "\nIPv6 Routing Header"); pstIpv6RoutingHeader = (struct bcm_ipv6_routing_hdr *)pucPayloadPtr; @@ -66,6 +67,7 @@ static UCHAR *GetNextIPV6ChainedHeader(UCHAR **ppucPayload, { struct bcm_ipv6_dest_options_hdr *pstIpv6DestOptsHdr = (struct bcm_ipv6_dest_options_hdr *)pucPayloadPtr; int nTotalOptions = pstIpv6DestOptsHdr->ucHdrExtLen; + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, "\nIPv6 DestOpts Header Header"); @@ -78,6 +80,7 @@ static UCHAR *GetNextIPV6ChainedHeader(UCHAR **ppucPayload, { struct bcm_ipv6_authentication_hdr *pstIpv6AuthHdr = (struct bcm_ipv6_authentication_hdr *)pucPayloadPtr; int nHdrLen = pstIpv6AuthHdr->ucLength; + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, "\nIPv6 Authentication Header"); @@ -275,6 +278,7 @@ USHORT IpVersion6(struct bcm_mini_adapter *Adapter, PVOID pcIpHeader, if (bClassificationSucceed == TRUE) { INT iMatchedSFQueueIndex = 0; + iMatchedSFQueueIndex = SearchSfid(Adapter, pstClassifierRule->ulSFID); if (iMatchedSFQueueIndex >= NO_OF_QUEUES) { bClassificationSucceed = false; @@ -407,6 +411,7 @@ VOID DumpIpv6Address(ULONG *puIpv6Address) UINT uiIpv6AddrNoLongWords = 4; UINT uiIpv6AddIndex = 0; struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev); + for (uiIpv6AddIndex = 0; uiIpv6AddIndex < uiIpv6AddrNoLongWords; uiIpv6AddIndex++) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, ":%lx", puIpv6Address[uiIpv6AddIndex]); @@ -419,6 +424,7 @@ static VOID DumpIpv6Header(struct bcm_ipv6_hdr *pstIpv6Header) UCHAR ucVersion; UCHAR ucPrio; struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV6_DBG, DBG_LVL_ALL, "Ipv6 Header---"); ucVersion = pstIpv6Header->ucVersionPrio & 0xf0; diff --git a/drivers/staging/bcm/InterfaceDld.c b/drivers/staging/bcm/InterfaceDld.c index e1925bd..abc7a7a 100644 --- a/drivers/staging/bcm/InterfaceDld.c +++ b/drivers/staging/bcm/InterfaceDld.c @@ -244,6 +244,7 @@ static INT buffDnld(struct bcm_mini_adapter *Adapter, { unsigned int len = 0; int retval = STATUS_SUCCESS; + len = u32FirmwareLength; while (u32FirmwareLength) { diff --git a/drivers/staging/bcm/InterfaceInit.c b/drivers/staging/bcm/InterfaceInit.c index bef13a6..bb61d34 100644 --- a/drivers/staging/bcm/InterfaceInit.c +++ b/drivers/staging/bcm/InterfaceInit.c @@ -440,6 +440,7 @@ static int select_alternate_setting_for_highspeed_modem( * Else USB_IF will fail.
Re: [PATCH] staging: nvec: remove unneccessary 'else' after 'return' statement
On Fri, Jul 04, 2014 at 09:57:50PM +0200, Pawel Lebioda wrote: > Hi, > > This patch fixes the following warning reported by checkpatch.pl: > > WARNING: else is not generally useful after a break or return > #235: FILE: drivers/staging/nvec/nvec.c:235: > > Regards > Pawel Lebioda > > Signed-off-by: Pawel Lebioda > drivers/staging/nvec/nvec.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Hi Pawel, Please format your patches correctly. There should be no "Hi", no "Regards", etc. After the signed off should be a dashed line. Use git format-patch to format patches and you can send them using git-send-email. See Documentation/SubmittingPatches for more details Thanks, -- Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/. Be friendly, do not top-post, and follow RFC 1855 "Netiquette". - If you don't I might ignore you. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel