struct port_data data;
struct sp_port_config prev_config;
+ CHECK_PORT();
+
+ if (!config)
+ return SP_ERR_ARG;
+
TRY(get_config(port, &data, &prev_config));
TRY(set_config(port, &data, config));
#define CREATE_SETTER(x) int sp_set_##x(struct sp_port *port, int x) { \
struct port_data data; \
struct sp_port_config config; \
+ CHECK_PORT(); \
TRY(get_config(port, &data, &config)); \
config.x = x; \
TRY(set_config(port, &data, &config)); \
struct port_data data;
struct sp_port_config config;
+ CHECK_PORT();
+
TRY(get_config(port, &data, &config));
if (flowcontrol == SP_FLOWCONTROL_XONXOFF)