net: devlink: regions: Add a priv member to the regions ops struct
authorAndrew Lunn <andrew@lunn.ch>
Fri, 18 Sep 2020 19:11:01 +0000 (21:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 19 Sep 2020 01:17:44 +0000 (18:17 -0700)
The driver may have multiple regions which can be dumped using one
function. However, for this to work, additional information is
needed. Add a priv member to the ops structure for the driver to use
however it likes.

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/devlink.h

index 73065f0..b68e483 100644 (file)
@@ -561,12 +561,14 @@ struct devlink_info_req;
  *            the data variable must be updated to point to the snapshot data.
  *            The function will be called while the devlink instance lock is
  *            held.
+ * @priv: Pointer to driver private data for the region operation
  */
 struct devlink_region_ops {
        const char *name;
        void (*destructor)(const void *data);
        int (*snapshot)(struct devlink *devlink, struct netlink_ext_ack *extack,
                        u8 **data);
+       void *priv;
 };
 
 struct devlink_fmsg;