public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: typec: Don't prevent using constant typec_mode_desc initializers
@ 2017-04-24 14:24 Mats Karrman
  2017-04-24 17:18 ` Guenter Roeck
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Mats Karrman @ 2017-04-24 14:24 UTC (permalink / raw)
  To: Heikki Krogerus; +Cc: felipe.balbi, groeck, linux-usb, linux-kernel

 From 98ff2be4de83f4d4b5293bfa424c274b25400e1e Mon Sep 17 00:00:00 2001
From: Mats Karrman <mats.dev.list@gmail.com>
Date: Mon, 24 Apr 2017 15:21:39 +0200
Subject: [PATCH] usb: typec: Don't prevent using constant 
typec_mode_desc initializers

---
  drivers/usb/typec/typec.c | 11 ++++++-----
  include/linux/usb/typec.h |  6 +++---
  2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/typec/typec.c b/drivers/usb/typec/typec.c
index 89e540b..db5ee73 100644
--- a/drivers/usb/typec/typec.c
+++ b/drivers/usb/typec/typec.c
@@ -291,7 +291,7 @@ typec_altmode_roles_show(struct device *dev, struct 
device_attribute *attr,
  }

  static void typec_init_modes(struct typec_altmode *alt,
-                 struct typec_mode_desc *desc, bool is_port)
+                 const struct typec_mode_desc *desc, bool is_port)
  {
      int i;

@@ -378,7 +378,8 @@ static const struct device_type 
typec_altmode_dev_type = {
  };

  static struct typec_altmode *
-typec_register_altmode(struct device *parent, struct typec_altmode_desc 
*desc)
+typec_register_altmode(struct device *parent,
+               const struct typec_altmode_desc *desc)
  {
      struct typec_altmode *alt;
      int ret;
@@ -495,7 +496,7 @@ EXPORT_SYMBOL_GPL(typec_partner_set_identity);
   */
  struct typec_altmode *
  typec_partner_register_altmode(struct typec_partner *partner,
-                   struct typec_altmode_desc *desc)
+                   const struct typec_altmode_desc *desc)
  {
      return typec_register_altmode(&partner->dev, desc);
  }
@@ -590,7 +591,7 @@ static const struct device_type typec_plug_dev_type = {
   */
  struct typec_altmode *
  typec_plug_register_altmode(struct typec_plug *plug,
-                struct typec_altmode_desc *desc)
+                const struct typec_altmode_desc *desc)
  {
      return typec_register_altmode(&plug->dev, desc);
  }
@@ -1159,7 +1160,7 @@ EXPORT_SYMBOL_GPL(typec_set_pwr_opmode);
   */
  struct typec_altmode *
  typec_port_register_altmode(struct typec_port *port,
-                struct typec_altmode_desc *desc)
+                const struct typec_altmode_desc *desc)
  {
      return typec_register_altmode(&port->dev, desc);
  }
diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
index ec78204..d1d2ebc 100644
--- a/include/linux/usb/typec.h
+++ b/include/linux/usb/typec.h
@@ -117,13 +117,13 @@ struct typec_altmode_desc {

  struct typec_altmode
  *typec_partner_register_altmode(struct typec_partner *partner,
-                struct typec_altmode_desc *desc);
+                const struct typec_altmode_desc *desc);
  struct typec_altmode
  *typec_plug_register_altmode(struct typec_plug *plug,
-                 struct typec_altmode_desc *desc);
+                 const struct typec_altmode_desc *desc);
  struct typec_altmode
  *typec_port_register_altmode(struct typec_port *port,
-                 struct typec_altmode_desc *desc);
+                 const struct typec_altmode_desc *desc);
  void typec_unregister_altmode(struct typec_altmode *altmode);

  struct typec_port *typec_altmode2port(struct typec_altmode *alt);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-04-25 18:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-24 14:24 [PATCH] usb: typec: Don't prevent using constant typec_mode_desc initializers Mats Karrman
2017-04-24 17:18 ` Guenter Roeck
2017-04-24 18:23 ` [PATCH v2] " Mats Karrman
2017-04-24 18:52   ` [PATCH v3] " Mats Karrman
2017-04-25  5:23     ` Guenter Roeck
2017-04-25 17:59     ` Greg KH
2017-04-25  8:21 ` [PATCH] " Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox