Changeset a1b7e80 in mainline for uspace/drv/char/ns8250/ns8250.c
- Timestamp:
- 2011-09-02T16:54:18Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f480d7e
- Parents:
- 7a72ce1a (diff), 224c0e7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/ns8250/ns8250.c
r7a72ce1a ra1b7e80 112 112 fibril_mutex_t mutex; 113 113 } ns8250_t; 114 115 /** Create per-device soft-state structure.116 *117 * @return Pointer to soft-state structure.118 */119 static ns8250_t *ns8250_new(void)120 {121 ns8250_t *ns;122 123 ns = (ns8250_t *) calloc(1, sizeof(ns8250_t));124 if (ns == NULL)125 return NULL;126 127 fibril_mutex_initialize(&ns->mutex);128 return ns;129 }130 131 /** Delete soft-state structure.132 *133 * @param ns The driver data structure.134 */135 static void ns8250_delete(ns8250_t *ns)136 {137 assert(ns != NULL);138 free(ns);139 }140 114 141 115 /** Find out if there is some incomming data available on the serial port. … … 721 695 722 696 /* Allocate soft-state for the device */ 723 ns = ns8250_new();697 ns = ddf_dev_data_alloc(dev, sizeof(ns8250_t)); 724 698 if (ns == NULL) { 725 699 rc = ENOMEM; … … 727 701 } 728 702 703 fibril_mutex_initialize(&ns->mutex); 729 704 ns->dev = dev; 730 dev->driver_data = ns;731 705 732 706 rc = ns8250_dev_initialize(ns); … … 792 766 if (need_cleanup) 793 767 ns8250_dev_cleanup(ns); 794 if (ns != NULL)795 ns8250_delete(ns);796 768 return rc; 797 769 }
Note:
See TracChangeset
for help on using the changeset viewer.