Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 617876 | Differences between
and this patch

Collapse All | Expand All

(-)a/drivers/dahdi/dahdi-sysfs-chan.c (+38 lines)
Lines 158-163 static BUS_ATTR_READER(ec_state_show, dev, buf) Link Here
158
	return len;
158
	return len;
159
}
159
}
160
160
161
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
161
static struct device_attribute chan_dev_attrs[] = {
162
static struct device_attribute chan_dev_attrs[] = {
162
	__ATTR_RO(name),
163
	__ATTR_RO(name),
163
	__ATTR_RO(channo),
164
	__ATTR_RO(channo),
Lines 174-179 static struct device_attribute chan_dev_attrs[] = { Link Here
174
	__ATTR_RO(in_use),
175
	__ATTR_RO(in_use),
175
	__ATTR_NULL,
176
	__ATTR_NULL,
176
};
177
};
178
#else
179
static DEVICE_ATTR_RO(name);
180
static DEVICE_ATTR_RO(channo);
181
static DEVICE_ATTR_RO(chanpos);
182
static DEVICE_ATTR_RO(sig);
183
static DEVICE_ATTR_RO(sigcap);
184
static DEVICE_ATTR_RO(alarms);
185
static DEVICE_ATTR_RO(ec_factory);
186
static DEVICE_ATTR_RO(ec_state);
187
static DEVICE_ATTR_RO(blocksize);
188
#ifdef OPTIMIZE_CHANMUTE
189
static DEVICE_ATTR_RO(chanmute);
190
#endif
191
static DEVICE_ATTR_RO(in_use);
192
193
static struct attribute *chan_dev_attrs[] = {
194
	&dev_attr_name.attr,
195
	&dev_attr_channo.attr,
196
	&dev_attr_chanpos.attr,
197
	&dev_attr_sig.attr,
198
	&dev_attr_sigcap.attr,
199
	&dev_attr_alarms.attr,
200
	&dev_attr_ec_factory.attr,
201
	&dev_attr_ec_state.attr,
202
	&dev_attr_blocksize.attr,
203
#ifdef OPTIMIZE_CHANMUTE
204
	&dev_attr_chanmute.attr,
205
#endif
206
	&dev_attr_in_use.attr,
207
	NULL,
208
};
209
ATTRIBUTE_GROUPS(chan_dev);
210
#endif
177
211
178
static void chan_release(struct device *dev)
212
static void chan_release(struct device *dev)
179
{
213
{
Lines 196-202 static int chan_match(struct device *dev, struct device_driver *driver) Link Here
196
static struct bus_type chan_bus_type = {
230
static struct bus_type chan_bus_type = {
197
	.name		= "dahdi_channels",
231
	.name		= "dahdi_channels",
198
	.match		= chan_match,
232
	.match		= chan_match,
233
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
199
	.dev_attrs	= chan_dev_attrs,
234
	.dev_attrs	= chan_dev_attrs,
235
#else
236
	.dev_groups	= chan_dev_groups,
237
#endif
200
};
238
};
201
239
202
static int chan_probe(struct device *dev)
240
static int chan_probe(struct device *dev)
(-)a/drivers/dahdi/dahdi-sysfs.c (-16 / +85 lines)
Lines 214-219 static BUS_ATTR_READER(linecompat_show, dev, buf) Link Here
214
	return len;
214
	return len;
215
}
215
}
216
216
217
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
217
static struct device_attribute span_dev_attrs[] = {
218
static struct device_attribute span_dev_attrs[] = {
218
	__ATTR_RO(name),
219
	__ATTR_RO(name),
219
	__ATTR_RO(desc),
220
	__ATTR_RO(desc),
Lines 230-235 static struct device_attribute span_dev_attrs[] = { Link Here
230
	__ATTR_RO(linecompat),
231
	__ATTR_RO(linecompat),
231
	__ATTR_NULL,
232
	__ATTR_NULL,
232
};
233
};
234
#else
235
static DEVICE_ATTR_RO(name);
236
static DEVICE_ATTR_RO(desc);
237
static DEVICE_ATTR_RO(spantype);
238
static DEVICE_ATTR_RO(local_spanno);
239
static DEVICE_ATTR_RO(alarms);
240
static DEVICE_ATTR_RO(lbo);
241
static DEVICE_ATTR_RO(syncsrc);
242
static DEVICE_ATTR_RO(is_digital);
243
static DEVICE_ATTR_RO(is_sync_master);
244
static DEVICE_ATTR_RO(basechan);
245
static DEVICE_ATTR_RO(channels);
246
static DEVICE_ATTR_RO(lineconfig);
247
static DEVICE_ATTR_RO(linecompat);
248
249
static struct attribute *span_dev_attrs[] = {
250
	&dev_attr_name.attr,
251
	&dev_attr_desc.attr,
252
	&dev_attr_spantype.attr,
253
	&dev_attr_local_spanno.attr,
254
	&dev_attr_lbo.attr,
255
	&dev_attr_alarms.attr,
256
	&dev_attr_syncsrc.attr,
257
	&dev_attr_is_digital.attr,
258
	&dev_attr_is_sync_master.attr,
259
	&dev_attr_basechan.attr,
260
	&dev_attr_channels.attr,
261
	&dev_attr_lineconfig.attr,
262
	&dev_attr_linecompat.attr,
263
	NULL,
264
};
265
ATTRIBUTE_GROUPS(span_dev);
266
#endif
233
267
234
static ssize_t master_span_show(struct device_driver *driver, char *buf)
268
static ssize_t master_span_show(struct device_driver *driver, char *buf)
235
{
269
{
Lines 270-276 static struct bus_type spans_bus_type = { Link Here
270
	.name           = "dahdi_spans",
304
	.name           = "dahdi_spans",
271
	.match          = span_match,
305
	.match          = span_match,
272
	.uevent         = span_uevent,
306
	.uevent         = span_uevent,
307
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
273
	.dev_attrs	= span_dev_attrs,
308
	.dev_attrs	= span_dev_attrs,
309
#else
310
	.dev_groups	= span_dev_groups,
311
#endif
274
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
312
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
275
	.drv_attrs	= dahdi_attrs,
313
	.drv_attrs	= dahdi_attrs,
276
#else
314
#else
Lines 482-488 static int device_uevent(struct device *dev, struct kobj_uevent_env *kenv) Link Here
482
#endif
520
#endif
483
521
484
static ssize_t
522
static ssize_t
485
dahdi_device_manufacturer_show(struct device *dev,
523
manufacturer_show(struct device *dev,
486
			       struct device_attribute *attr, char *buf)
524
			       struct device_attribute *attr, char *buf)
487
{
525
{
488
	struct dahdi_device *ddev = to_ddev(dev);
526
	struct dahdi_device *ddev = to_ddev(dev);
Lines 490-496 dahdi_device_manufacturer_show(struct device *dev, Link Here
490
}
528
}
491
529
492
static ssize_t
530
static ssize_t
493
dahdi_device_type_show(struct device *dev,
531
type_show(struct device *dev,
494
		       struct device_attribute *attr, char *buf)
532
		       struct device_attribute *attr, char *buf)
495
{
533
{
496
	struct dahdi_device *ddev = to_ddev(dev);
534
	struct dahdi_device *ddev = to_ddev(dev);
Lines 498-504 dahdi_device_type_show(struct device *dev, Link Here
498
}
536
}
499
537
500
static ssize_t
538
static ssize_t
501
dahdi_device_span_count_show(struct device *dev,
539
span_count_show(struct device *dev,
502
			     struct device_attribute *attr, char *buf)
540
			     struct device_attribute *attr, char *buf)
503
{
541
{
504
	struct dahdi_device *ddev = to_ddev(dev);
542
	struct dahdi_device *ddev = to_ddev(dev);
Lines 512-518 dahdi_device_span_count_show(struct device *dev, Link Here
512
}
550
}
513
551
514
static ssize_t
552
static ssize_t
515
dahdi_device_hardware_id_show(struct device *dev,
553
hardware_id_show(struct device *dev,
516
			     struct device_attribute *attr, char *buf)
554
			     struct device_attribute *attr, char *buf)
517
{
555
{
518
	struct dahdi_device *ddev = to_ddev(dev);
556
	struct dahdi_device *ddev = to_ddev(dev);
Lines 522-528 dahdi_device_hardware_id_show(struct device *dev, Link Here
522
}
560
}
523
561
524
static ssize_t
562
static ssize_t
525
dahdi_device_location_show(struct device *dev,
563
location_show(struct device *dev,
526
			     struct device_attribute *attr, char *buf)
564
			     struct device_attribute *attr, char *buf)
527
{
565
{
528
	struct dahdi_device *ddev = to_ddev(dev);
566
	struct dahdi_device *ddev = to_ddev(dev);
Lines 532-538 dahdi_device_location_show(struct device *dev, Link Here
532
}
570
}
533
571
534
static ssize_t
572
static ssize_t
535
dahdi_device_auto_assign(struct device *dev, struct device_attribute *attr,
573
auto_assign_store(struct device *dev, struct device_attribute *attr,
536
			 const char *buf, size_t count)
574
			 const char *buf, size_t count)
537
{
575
{
538
	struct dahdi_device *ddev = to_ddev(dev);
576
	struct dahdi_device *ddev = to_ddev(dev);
Lines 541-547 dahdi_device_auto_assign(struct device *dev, struct device_attribute *attr, Link Here
541
}
579
}
542
580
543
static ssize_t
581
static ssize_t
544
dahdi_device_assign_span(struct device *dev, struct device_attribute *attr,
582
assign_span_store(struct device *dev, struct device_attribute *attr,
545
			 const char *buf, size_t count)
583
			 const char *buf, size_t count)
546
{
584
{
547
	int ret;
585
	int ret;
Lines 576-582 dahdi_device_assign_span(struct device *dev, struct device_attribute *attr, Link Here
576
}
614
}
577
615
578
static ssize_t
616
static ssize_t
579
dahdi_device_unassign_span(struct device *dev, struct device_attribute *attr,
617
unassign_span_store(struct device *dev, struct device_attribute *attr,
580
			   const char *buf, size_t count)
618
			   const char *buf, size_t count)
581
{
619
{
582
	int ret;
620
	int ret;
Lines 690-714 dahdi_registration_time_show(struct device *dev, Link Here
690
	return count;
728
	return count;
691
}
729
}
692
730
731
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
693
static struct device_attribute dahdi_device_attrs[] = {
732
static struct device_attribute dahdi_device_attrs[] = {
694
	__ATTR(manufacturer, S_IRUGO, dahdi_device_manufacturer_show, NULL),
733
	__ATTR(manufacturer, S_IRUGO, manufacturer_show, NULL),
695
	__ATTR(type, S_IRUGO, dahdi_device_type_show, NULL),
734
	__ATTR(type, S_IRUGO, type_show, NULL),
696
	__ATTR(span_count, S_IRUGO, dahdi_device_span_count_show, NULL),
735
	__ATTR(span_count, S_IRUGO, span_count_show, NULL),
697
	__ATTR(hardware_id, S_IRUGO, dahdi_device_hardware_id_show, NULL),
736
	__ATTR(hardware_id, S_IRUGO, hardware_id_show, NULL),
698
	__ATTR(location, S_IRUGO, dahdi_device_location_show, NULL),
737
	__ATTR(location, S_IRUGO, location_show, NULL),
699
	__ATTR(auto_assign, S_IWUSR, NULL, dahdi_device_auto_assign),
738
	__ATTR(auto_assign, S_IWUSR, NULL, auto_assign_store),
700
	__ATTR(assign_span, S_IWUSR, NULL, dahdi_device_assign_span),
739
	__ATTR(assign_span, S_IWUSR, NULL, assign_span_store),
701
	__ATTR(unassign_span, S_IWUSR, NULL, dahdi_device_unassign_span),
740
	__ATTR(unassign_span, S_IWUSR, NULL, unassign_span_store),
702
	__ATTR(spantype, S_IWUSR | S_IRUGO, dahdi_spantype_show,
741
	__ATTR(spantype, S_IWUSR | S_IRUGO, dahdi_spantype_show,
703
	       dahdi_spantype_store),
742
	       dahdi_spantype_store),
704
	__ATTR(registration_time, S_IRUGO, dahdi_registration_time_show, NULL),
743
	__ATTR(registration_time, S_IRUGO, dahdi_registration_time_show, NULL),
705
	__ATTR_NULL,
744
	__ATTR_NULL,
706
};
745
};
746
#else
747
static DEVICE_ATTR_RO(manufacturer);
748
static DEVICE_ATTR_RO(type);
749
static DEVICE_ATTR_RO(span_count);
750
static DEVICE_ATTR_RO(hardware_id);
751
static DEVICE_ATTR_RO(location);
752
static DEVICE_ATTR_WO(auto_assign);
753
static DEVICE_ATTR_WO(assign_span);
754
static DEVICE_ATTR_WO(unassign_span);
755
static DEVICE_ATTR_RW(dahdi_spantype);
756
static DEVICE_ATTR_RO(dahdi_registration_time);
757
static struct attribute *dahdi_device_attrs[] = {
758
	&dev_attr_manufacturer.attr,
759
	&dev_attr_type.attr,
760
	&dev_attr_span_count.attr,
761
	&dev_attr_hardware_id.attr,
762
	&dev_attr_location.attr,
763
	&dev_attr_auto_assign.attr,
764
	&dev_attr_assign_span.attr,
765
	&dev_attr_unassign_span.attr,
766
	&dev_attr_dahdi_spantype.attr,
767
	&dev_attr_dahdi_registration_time.attr,
768
	NULL,
769
};
770
ATTRIBUTE_GROUPS(dahdi_device);
771
#endif
707
772
708
static struct bus_type dahdi_device_bus = {
773
static struct bus_type dahdi_device_bus = {
709
	.name = "dahdi_devices",
774
	.name = "dahdi_devices",
710
	.uevent         = device_uevent,
775
	.uevent         = device_uevent,
776
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
711
	.dev_attrs = dahdi_device_attrs,
777
	.dev_attrs = dahdi_device_attrs,
778
#else
779
	.dev_groups = dahdi_device_groups,
780
#endif
712
};
781
};
713
782
714
static void dahdi_sysfs_cleanup(void)
783
static void dahdi_sysfs_cleanup(void)
(-)a/drivers/dahdi/xpp/xbus-sysfs.c (+66 lines)
Lines 339-344 static DEVICE_ATTR_READER(dahdi_registration_show, dev, buf) Link Here
339
	return len;
339
	return len;
340
}
340
}
341
341
342
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
342
static struct device_attribute xbus_dev_attrs[] = {
343
static struct device_attribute xbus_dev_attrs[] = {
343
	__ATTR_RO(connector),
344
	__ATTR_RO(connector),
344
	__ATTR_RO(label),
345
	__ATTR_RO(label),
Lines 358-363 static struct device_attribute xbus_dev_attrs[] = { Link Here
358
		dahdi_registration_store),
359
		dahdi_registration_store),
359
	__ATTR_NULL,
360
	__ATTR_NULL,
360
};
361
};
362
#else
363
static DEVICE_ATTR_RO(connector);
364
static DEVICE_ATTR_RO(label);
365
static DEVICE_ATTR_RO(status);
366
static DEVICE_ATTR_RO(timing);
367
static DEVICE_ATTR_RO(refcount_xbus);
368
static DEVICE_ATTR_RO(waitfor_xpds);
369
static DEVICE_ATTR_RO(driftinfo);
370
static DEVICE_ATTR_WO(cls);
371
static DEVICE_ATTR_RW(xbus_state);
372
#ifdef	SAMPLE_TICKS
373
static DEVICE_ATTR_RO(samples);
374
#endif
375
static DEVICE_ATTR_RW(dahdi_registration);
376
377
static struct attribute *xbus_dev_attrs[] = {
378
   &dev_attr_connector.attr,
379
   &dev_attr_label.attr,
380
   &dev_attr_status.attr,
381
   &dev_attr_timing.attr,
382
   &dev_attr_refcount_xbus.attr,
383
   &dev_attr_waitfor_xpds.attr,
384
   &dev_attr_driftinfo.attr,
385
   &dev_attr_cls.attr,
386
   &dev_attr_xbus_state.attr,
387
#ifdef	SAMPLE_TICKS
388
   &dev_attr_samples.attr,
389
#endif
390
   &dev_attr_dahdi_registration.attr,
391
   NULL,
392
};
393
ATTRIBUTE_GROUPS(xbus_dev);
394
#endif
361
395
362
static int astribank_match(struct device *dev, struct device_driver *driver)
396
static int astribank_match(struct device *dev, struct device_driver *driver)
363
{
397
{
Lines 457-463 static struct bus_type toplevel_bus_type = { Link Here
457
	.name = "astribanks",
491
	.name = "astribanks",
458
	.match = astribank_match,
492
	.match = astribank_match,
459
	.uevent = astribank_uevent,
493
	.uevent = astribank_uevent,
494
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
460
	.dev_attrs = xbus_dev_attrs,
495
	.dev_attrs = xbus_dev_attrs,
496
#else
497
	.dev_groups = xbus_dev_groups,
498
#endif
461
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
499
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
462
	.drv_attrs = xpp_attrs,
500
	.drv_attrs = xpp_attrs,
463
#else
501
#else
Lines 769-774 static int xpd_match(struct device *dev, struct device_driver *driver) Link Here
769
	return 1;
807
	return 1;
770
}
808
}
771
809
810
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
772
static struct device_attribute xpd_dev_attrs[] = {
811
static struct device_attribute xpd_dev_attrs[] = {
773
	__ATTR(chipregs, S_IRUGO | S_IWUSR, chipregs_show, chipregs_store),
812
	__ATTR(chipregs, S_IRUGO | S_IWUSR, chipregs_show, chipregs_store),
774
	__ATTR(blink, S_IRUGO | S_IWUSR, blink_show, blink_store),
813
	__ATTR(blink, S_IRUGO | S_IWUSR, blink_show, blink_store),
Lines 780-790 static struct device_attribute xpd_dev_attrs[] = { Link Here
780
	__ATTR_RO(refcount_xpd),
819
	__ATTR_RO(refcount_xpd),
781
	__ATTR_NULL,
820
	__ATTR_NULL,
782
};
821
};
822
#else
823
static DEVICE_ATTR_RW(chipregs);
824
static DEVICE_ATTR_RW(blink);
825
static DEVICE_ATTR_RW(span);
826
static DEVICE_ATTR_RO(type);
827
//static DEVICE_ATTR_RO(hwid);
828
static DEVICE_ATTR_RO(offhook);
829
static DEVICE_ATTR_RO(timing_priority);
830
static DEVICE_ATTR_RO(refcount_xpd);
831
832
static struct attribute *xpd_dev_attrs[] = {
833
   &dev_attr_chipregs.attr,
834
   &dev_attr_blink.attr,
835
   &dev_attr_span.attr,
836
   &dev_attr_type.attr,
837
   //&dev_attr_hwid.attr,
838
   &dev_attr_offhook.attr,
839
   &dev_attr_timing_priority.attr,
840
   &dev_attr_refcount_xpd.attr,
841
   NULL,
842
};
843
ATTRIBUTE_GROUPS(xpd_dev);
844
#endif
783
845
784
static struct bus_type xpd_type = {
846
static struct bus_type xpd_type = {
785
	.name = "xpds",
847
	.name = "xpds",
786
	.match = xpd_match,
848
	.match = xpd_match,
849
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
787
	.dev_attrs = xpd_dev_attrs,
850
	.dev_attrs = xpd_dev_attrs,
851
#else
852
	.dev_groups = xpd_dev_groups,
853
#endif
788
};
854
};
789
855
790
int xpd_driver_register(struct device_driver *driver)
856
int xpd_driver_register(struct device_driver *driver)

Return to bug 617876